1 | <?php |
||
18 | class BaseService implements IMusicService |
||
19 | { |
||
20 | const ERR_METHOD_NOT_IMPLEMENTED = "Method not implemented"; |
||
21 | /** |
||
22 | * @var ClientInterface |
||
23 | */ |
||
24 | protected $client; |
||
25 | |||
26 | protected $apiClient; |
||
27 | |||
28 | protected $config; |
||
29 | |||
30 | protected $initialized = false; |
||
31 | |||
32 | /** |
||
33 | * @return ClientInterface |
||
34 | */ |
||
35 | 1 | public function getClient() |
|
39 | |||
40 | /** |
||
41 | * @param ClientInterface $client |
||
42 | * |
||
43 | * @return BaseService |
||
44 | */ |
||
45 | 39 | public function setClient(ClientInterface $client) |
|
51 | |||
52 | /** |
||
53 | * @return mixed |
||
54 | */ |
||
55 | 39 | public function getApiClient() |
|
59 | |||
60 | /** |
||
61 | * @param mixed $apiClient |
||
62 | * |
||
63 | * @return BaseService |
||
64 | */ |
||
65 | 39 | public function setApiClient($apiClient) |
|
71 | |||
72 | /** |
||
73 | * @return mixed |
||
74 | */ |
||
75 | 39 | public function getConfig() |
|
79 | |||
80 | /** |
||
81 | * @param mixed $config |
||
82 | * |
||
83 | * @return BaseService |
||
84 | */ |
||
85 | 39 | public function setConfig($config = null) |
|
91 | |||
92 | /** |
||
93 | * @return boolean |
||
94 | */ |
||
95 | 22 | public function isInitialized() |
|
99 | |||
100 | /** |
||
101 | * @param boolean $initialized |
||
102 | * |
||
103 | * @return BaseService |
||
104 | */ |
||
105 | 39 | public function setInitialized($initialized) |
|
111 | |||
112 | |||
113 | /** |
||
114 | * Service specific initializer |
||
115 | * |
||
116 | * Construct your API client in this method. |
||
117 | * It is set to be the method that is called by Symfony's Service Loader |
||
118 | * |
||
119 | * @param array $config |
||
120 | * |
||
121 | * @return void |
||
122 | * @throws ServiceConfigurationException |
||
123 | */ |
||
124 | 1 | public function init($config = []) |
|
128 | |||
129 | /** |
||
130 | * |
||
131 | * @throws ServiceConfigurationException |
||
132 | * @return IMusicServiceEndpoint |
||
133 | */ |
||
134 | 1 | public function artist() |
|
138 | |||
139 | /** |
||
140 | * |
||
141 | * @throws ServiceConfigurationException |
||
142 | * @return IMusicServiceEndpoint |
||
143 | */ |
||
144 | 1 | public function album() |
|
148 | |||
149 | /** |
||
150 | * |
||
151 | * @throws ServiceConfigurationException |
||
152 | * @return IMusicServiceEndpoint |
||
153 | */ |
||
154 | 1 | public function song() |
|
158 | |||
159 | /** |
||
160 | * |
||
161 | * @throws ServiceConfigurationException |
||
162 | * @return IMusicServiceEndpoint |
||
163 | */ |
||
164 | 1 | public function track() |
|
168 | } |