1 | <?php |
||
19 | class BaseService implements IMusicService |
||
20 | { |
||
21 | const ERR_METHOD_NOT_IMPLEMENTED = "Method not implemented"; |
||
22 | /** |
||
23 | * @var ClientInterface |
||
24 | */ |
||
25 | protected $client; |
||
26 | |||
27 | protected $apiClient; |
||
28 | |||
29 | protected $config; |
||
30 | |||
31 | protected $initialized = false; |
||
32 | |||
33 | /** |
||
34 | * @var CacheItemPoolInterface |
||
35 | */ |
||
36 | protected $cache; |
||
37 | |||
38 | /** |
||
39 | * @return ClientInterface |
||
40 | */ |
||
41 | 1 | public function getClient() |
|
45 | |||
46 | /** |
||
47 | * @param ClientInterface $client |
||
48 | * |
||
49 | * @return BaseService |
||
50 | */ |
||
51 | 39 | public function setClient(ClientInterface $client) |
|
57 | |||
58 | /** |
||
59 | * @return mixed |
||
60 | */ |
||
61 | 39 | public function getApiClient() |
|
65 | |||
66 | /** |
||
67 | * @param mixed $apiClient |
||
68 | * |
||
69 | * @return BaseService |
||
70 | */ |
||
71 | 39 | public function setApiClient($apiClient) |
|
77 | |||
78 | /** |
||
79 | * @return mixed |
||
80 | */ |
||
81 | 39 | public function getConfig() |
|
85 | |||
86 | /** |
||
87 | * @param mixed $config |
||
88 | * |
||
89 | * @return BaseService |
||
90 | */ |
||
91 | 39 | public function setConfig($config = null) |
|
97 | |||
98 | /** |
||
99 | * @return CacheItemPoolInterface |
||
100 | */ |
||
101 | 39 | public function getCache() |
|
105 | |||
106 | /** |
||
107 | * @param CacheItemPoolInterface $cache |
||
108 | * @return BaseService |
||
109 | */ |
||
110 | 39 | public function setCache(CacheItemPoolInterface $cache) |
|
116 | |||
117 | |||
118 | |||
119 | /** |
||
120 | * @return boolean |
||
121 | */ |
||
122 | 22 | public function isInitialized() |
|
126 | |||
127 | /** |
||
128 | * @param boolean $initialized |
||
129 | * |
||
130 | * @return BaseService |
||
131 | */ |
||
132 | 39 | public function setInitialized($initialized) |
|
138 | |||
139 | |||
140 | /** |
||
141 | * Service specific initializer |
||
142 | * |
||
143 | * Construct your API client in this method. |
||
144 | * It is set to be the method that is called by Symfony's Service Loader |
||
145 | * |
||
146 | * @param array $config |
||
147 | * |
||
148 | * @return void |
||
149 | * @throws ServiceConfigurationException |
||
150 | */ |
||
151 | 1 | public function init($config = []) |
|
155 | |||
156 | /** |
||
157 | * |
||
158 | * @throws ServiceConfigurationException |
||
159 | * @return IMusicServiceEndpoint |
||
160 | */ |
||
161 | 1 | public function artist() |
|
165 | |||
166 | /** |
||
167 | * |
||
168 | * @throws ServiceConfigurationException |
||
169 | * @return IMusicServiceEndpoint |
||
170 | */ |
||
171 | 1 | public function album() |
|
175 | |||
176 | /** |
||
177 | * |
||
178 | * @throws ServiceConfigurationException |
||
179 | * @return IMusicServiceEndpoint |
||
180 | */ |
||
181 | 1 | public function song() |
|
185 | |||
186 | /** |
||
187 | * |
||
188 | * @throws ServiceConfigurationException |
||
189 | * @return IMusicServiceEndpoint |
||
190 | */ |
||
191 | 1 | public function track() |
|
195 | } |
||
196 |