~xibo-maintainers/xibo/tempel

« back to all changes in this revision

Viewing changes to lib/Storage/ApiClientStorage.php

  • Committer: Dan Garner
  • Date: 2016-02-15 17:54:45 UTC
  • mto: (454.4.130)
  • mto: This revision was merged to the branch mainline in revision 484.
  • Revision ID: git-v1:dd226a6f84464ff28758a249e1fd52ca4a35d911
Correction to Layout Duration ToolTip
xibosignage/xibo#721

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
class ApiClientStorage extends AbstractStorage implements ClientInterface
31
31
{
32
32
    /**
33
 
     * @var StorageServiceInterface
34
 
     */
35
 
    private $store;
36
 
 
37
 
    /**
38
 
     * ApiAccessTokenStorage constructor.
39
 
     * @param StorageServiceInterface $store
40
 
     */
41
 
    public function __construct($store)
42
 
    {
43
 
        if (!$store instanceof StorageServiceInterface)
44
 
            throw new \RuntimeException('Invalid $store');
45
 
 
46
 
        $this->store = $store;
47
 
    }
48
 
 
49
 
    /**
50
 
     * Get Store
51
 
     * @return StorageServiceInterface
52
 
     */
53
 
    protected function getStore()
54
 
    {
55
 
        return $this->store;
56
 
    }
57
 
 
58
 
    /**
59
33
     * {@inheritdoc}
60
34
     */
61
35
    public function get($clientId, $clientSecret = null, $redirectUri = null, $grantType = null)
86
60
            $params['clientSecret'] = $clientSecret;
87
61
        }
88
62
 
89
 
        $result = $this->getStore()->select($sql, $params);
 
63
        $result = PDOConnect::select($sql, $params);
90
64
 
91
65
        if (count($result) === 1) {
92
66
            $client = new ClientEntity($this->server);
105
79
                    break;
106
80
 
107
81
                case 'client_credentials':
108
 
                case 'mcaas':
109
82
                    if ($result[0]['clientCredentials'] != 1)
110
83
                        return false;
111
84
 
126
99
     */
127
100
    public function getBySession(SessionEntity $session)
128
101
    {
129
 
        $result = $this->getStore()->select('
 
102
        $result = PDOConnect::select('
130
103
            SELECT oauth_clients.id, oauth_clients.name
131
104
              FROM oauth_clients
132
105
                INNER JOIN oauth_sessions ON oauth_clients.id = oauth_sessions.client_id