1 | <?php |
||
13 | class Application implements ApplicationInterface, CollectionableInterface |
||
14 | { |
||
15 | use CollectionableTrait, NormalizableTrait; |
||
16 | |||
17 | /** |
||
18 | * @var int |
||
19 | */ |
||
20 | protected $id; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $apiKey; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $secret; |
||
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $domain; |
||
36 | |||
37 | /** |
||
38 | * @var array |
||
39 | */ |
||
40 | protected $allowedScopes; |
||
41 | |||
42 | /** |
||
43 | * @var array |
||
44 | */ |
||
45 | protected $allowedGrantTypes; |
||
46 | |||
47 | /** |
||
48 | * @var array |
||
49 | */ |
||
50 | protected $roles; |
||
51 | |||
52 | /** |
||
53 | * @var array |
||
54 | */ |
||
55 | protected $accounts; |
||
56 | |||
57 | /** |
||
58 | * @see NormalizableInterface::getScope() |
||
59 | */ |
||
60 | 2 | public static function getScopes() |
|
61 | { |
||
62 | return array( |
||
63 | 2 | 'id' => 'id', |
|
64 | 1 | 'default' => array('id', 'domain', 'allowed_scopes'), |
|
65 | 1 | ); |
|
66 | } |
||
67 | |||
68 | /** |
||
69 | * Construct. |
||
70 | */ |
||
71 | 28 | public function __construct() |
|
77 | |||
78 | /** |
||
79 | * @return int |
||
80 | */ |
||
81 | public function getId() |
||
85 | |||
86 | /** |
||
87 | * @see ApplicationInterface::getApiKey() |
||
88 | */ |
||
89 | 2 | public function getApiKey() |
|
90 | { |
||
91 | 2 | return $this->apiKey; |
|
92 | } |
||
93 | |||
94 | /** |
||
95 | * Define Application apiKey value. |
||
96 | * |
||
97 | * @param string $apiKey |
||
98 | * |
||
99 | * @return self |
||
100 | */ |
||
101 | 2 | public function setApiKey($apiKey) |
|
102 | { |
||
103 | 2 | $this->apiKey = $apiKey; |
|
104 | |||
105 | 2 | return $this; |
|
106 | } |
||
107 | |||
108 | /** |
||
109 | * @see ApplicationInterface::getSecret() |
||
110 | */ |
||
111 | 2 | public function getSecret() |
|
112 | { |
||
113 | 2 | return $this->secret; |
|
114 | } |
||
115 | |||
116 | /** |
||
117 | * Define Application secret value. |
||
118 | * |
||
119 | * @param string $secret |
||
120 | * |
||
121 | * @return self |
||
122 | */ |
||
123 | 2 | public function setSecret($secret) |
|
124 | { |
||
125 | 2 | $this->secret = $secret; |
|
126 | |||
127 | 2 | return $this; |
|
128 | } |
||
129 | |||
130 | /** |
||
131 | * @see ApplicationInterface::getDomain() |
||
132 | */ |
||
133 | 2 | public function getDomain() |
|
134 | { |
||
135 | 2 | return $this->domain; |
|
136 | } |
||
137 | |||
138 | /** |
||
139 | * Define Application domain value. |
||
140 | * |
||
141 | * @param string $domain |
||
142 | * |
||
143 | * @return self |
||
144 | */ |
||
145 | 2 | public function setDomain($domain) |
|
146 | { |
||
147 | 2 | $this->domain = $domain; |
|
148 | |||
149 | 2 | return $this; |
|
150 | } |
||
151 | |||
152 | /** |
||
153 | * @see ApplicationInterface::getAllowedScopes() |
||
154 | */ |
||
155 | 2 | public function getAllowedScopes() |
|
156 | { |
||
157 | 2 | return $this->allowedScopes; |
|
158 | } |
||
159 | |||
160 | /** |
||
161 | * Define Application allowedScopes value. |
||
162 | * |
||
163 | * @param array $allowedScopes |
||
164 | * |
||
165 | * @return self |
||
166 | */ |
||
167 | 2 | public function setAllowedScopes(array $allowedScopes) |
|
168 | { |
||
169 | 2 | $this->allowedScopes = $allowedScopes; |
|
170 | |||
171 | 2 | return $this; |
|
172 | } |
||
173 | |||
174 | /** |
||
175 | * @see ApplicationInterface::getAllowedGrantTypes() |
||
176 | */ |
||
177 | 14 | public function getAllowedGrantTypes() |
|
181 | |||
182 | /** |
||
183 | * Define Application allowedGrantTypes value. |
||
184 | * |
||
185 | * @param array $allowedGrantTypes |
||
186 | * |
||
187 | * @return self |
||
188 | */ |
||
189 | 8 | public function setAllowedGrantTypes(array $allowedGrantTypes) |
|
195 | |||
196 | /** |
||
197 | * @see ApplicationInterface::getRoles() |
||
198 | */ |
||
199 | 2 | public function getRoles() |
|
200 | { |
||
201 | 2 | return $this->roles; |
|
202 | } |
||
203 | |||
204 | /** |
||
205 | * Define Application roles value. |
||
206 | * |
||
207 | * @param array $roles |
||
208 | * |
||
209 | * @return self |
||
210 | */ |
||
211 | 2 | public function setRoles(array $roles) |
|
217 | |||
218 | /** |
||
219 | * @return array |
||
220 | */ |
||
221 | 2 | public function getAccounts() |
|
225 | |||
226 | /** |
||
227 | * @param array $accounts |
||
228 | * |
||
229 | * @return self |
||
230 | */ |
||
231 | 2 | public function setAccounts($accounts) |
|
237 | } |
||
238 |