1 | <?php |
||
9 | class BaseService implements IMusicService |
||
10 | { |
||
11 | const ERR_METHOD_NOT_IMPLEMENTED = "Method not implemented"; |
||
12 | /** |
||
13 | * @var ClientInterface |
||
14 | */ |
||
15 | protected $client; |
||
16 | |||
17 | protected $apiClient; |
||
18 | |||
19 | protected $config; |
||
20 | |||
21 | protected $initialized = false; |
||
22 | |||
23 | /** |
||
24 | * @return ClientInterface |
||
25 | */ |
||
26 | public function getClient() |
||
30 | |||
31 | /** |
||
32 | * @param ClientInterface $client |
||
33 | * |
||
34 | * @return BaseService |
||
35 | */ |
||
36 | 19 | public function setClient(ClientInterface $client) |
|
42 | |||
43 | /** |
||
44 | * @return mixed |
||
45 | */ |
||
46 | 13 | public function getApiClient() |
|
50 | |||
51 | /** |
||
52 | * @param mixed $apiClient |
||
53 | * |
||
54 | * @return BaseService |
||
55 | */ |
||
56 | 13 | public function setApiClient($apiClient) |
|
62 | |||
63 | /** |
||
64 | * @return mixed |
||
65 | */ |
||
66 | 13 | public function getConfig() |
|
70 | |||
71 | /** |
||
72 | * @param mixed $config |
||
73 | * |
||
74 | * @return BaseService |
||
75 | */ |
||
76 | 19 | public function setConfig($config = null) |
|
82 | |||
83 | /** |
||
84 | * @return boolean |
||
85 | */ |
||
86 | 10 | public function isInitialized() |
|
90 | |||
91 | /** |
||
92 | * @param boolean $initialized |
||
93 | * |
||
94 | * @return BaseService |
||
95 | */ |
||
96 | 13 | public function setInitialized($initialized) |
|
102 | |||
103 | |||
104 | /** |
||
105 | * Service specific initializer |
||
106 | * |
||
107 | * Construct your API client in this method. |
||
108 | * It is set to be the method that is called by Symfony's Service Loader |
||
109 | * |
||
110 | * @param array $config |
||
111 | * |
||
112 | * @return void |
||
113 | * @throws ServiceConfigurationException |
||
114 | */ |
||
115 | public function init($config = []) |
||
119 | |||
120 | /** |
||
121 | * |
||
122 | * @throws ServiceConfigurationException |
||
123 | * @return IMusicServiceEndpoint |
||
124 | */ |
||
125 | public function artist() |
||
129 | |||
130 | /** |
||
131 | * |
||
132 | * @throws ServiceConfigurationException |
||
133 | * @return IMusicServiceEndpoint |
||
134 | */ |
||
135 | public function album() |
||
139 | |||
140 | /** |
||
141 | * |
||
142 | * @throws ServiceConfigurationException |
||
143 | * @return IMusicServiceEndpoint |
||
144 | */ |
||
145 | public function song() |
||
149 | |||
150 | /** |
||
151 | * |
||
152 | * @throws ServiceConfigurationException |
||
153 | * @return IMusicServiceEndpoint |
||
154 | */ |
||
155 | public function track() |
||
159 | } |