1 | <?php |
||
23 | class Application implements ApplicationInterface |
||
24 | { |
||
25 | /** |
||
26 | * Creates the application. |
||
27 | * |
||
28 | * @param array $config |
||
29 | * @param GuzzleAdapter $adapter |
||
30 | * @return Application |
||
31 | */ |
||
32 | 5 | public static function create(array $config, GuzzleAdapter $adapter = null) |
|
54 | |||
55 | /** |
||
56 | * @param $token |
||
57 | */ |
||
58 | 5 | private static function assertValidToken($token) |
|
64 | |||
65 | /** |
||
66 | * @var GuzzleAdapter |
||
67 | */ |
||
68 | private $adapter; |
||
69 | |||
70 | /** |
||
71 | * @var string Application client ID. Used by Oauth2Connector |
||
72 | */ |
||
73 | private $clientId; |
||
74 | |||
75 | /** |
||
76 | * @var string Application secret. Used by Oauth2Connector |
||
77 | */ |
||
78 | private $secret; |
||
79 | |||
80 | /** |
||
81 | * @var OAuth2Connector |
||
82 | */ |
||
83 | private $connector; |
||
84 | |||
85 | /** |
||
86 | * @var EntityManager[] |
||
87 | */ |
||
88 | private $entityManagers = array(); |
||
89 | |||
90 | /** |
||
91 | * @var APIGuzzleAdapter[] |
||
92 | */ |
||
93 | private $adapters = array(); |
||
94 | |||
95 | /** |
||
96 | * @var Uploader[] |
||
97 | */ |
||
98 | private $uploaders = array(); |
||
99 | |||
100 | /** |
||
101 | * @var Monitor[] |
||
102 | */ |
||
103 | private $monitors = array(); |
||
104 | |||
105 | 8 | public function __construct(GuzzleAdapter $adapter, $clientId, $secret) |
|
111 | |||
112 | /** |
||
113 | * Activate extended graph object by adding required accept headers. |
||
114 | * This results in bigger response message but less requests to get |
||
115 | * relation of queried object. |
||
116 | * |
||
117 | * @param $mode |
||
118 | */ |
||
119 | public function setExtendedMode($mode) |
||
123 | |||
124 | /** |
||
125 | * {@inheritdoc} |
||
126 | */ |
||
127 | 1 | public function getOauth2Connector() |
|
135 | |||
136 | /** |
||
137 | * {@inheritdoc} |
||
138 | */ |
||
139 | 1 | public function getUploader($token) |
|
149 | |||
150 | /** |
||
151 | * {@inheritdoc} |
||
152 | */ |
||
153 | 4 | public function getEntityManager($token) |
|
166 | |||
167 | /** |
||
168 | * {@inheritdoc} |
||
169 | */ |
||
170 | 1 | public function getMonitor($token) |
|
180 | |||
181 | /** |
||
182 | * Returns the guzzle adapter |
||
183 | * |
||
184 | * @return GuzzleAdapter |
||
185 | */ |
||
186 | public function getAdapter() |
||
190 | |||
191 | 3 | private function getAdapterByToken($token) |
|
204 | } |
||
205 |