1 | <?php |
||
10 | class iTunes |
||
11 | { |
||
12 | /** |
||
13 | * @var Client |
||
14 | */ |
||
15 | protected $client; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $endPoint = 'https://itunes.apple.com/search'; |
||
21 | |||
22 | /** |
||
23 | * iTunes constructor. |
||
24 | * |
||
25 | * @param Client|null $client |
||
26 | */ |
||
27 | public function __construct(Client $client = null) |
||
31 | |||
32 | /** |
||
33 | * Determines whether to use iTunes services. |
||
34 | * |
||
35 | * @return bool |
||
36 | */ |
||
37 | public function used() |
||
41 | |||
42 | /** |
||
43 | * Search for a track on iTunes Store with the given information and get its URL. |
||
44 | * |
||
45 | * @param $term string The main query string (should be the track's name) |
||
46 | * @param $album string The album's name, if available |
||
47 | * @param $artist string The artist's name, if available |
||
48 | * |
||
49 | * @return string|false |
||
50 | */ |
||
51 | public function getTrackUrl($term, $album = '', $artist = '') |
||
87 | } |
||
88 |