1 | <?php |
||
5 | class Volume extends Model |
||
6 | { |
||
7 | protected static $coverSizes = [ |
||
8 | 'extraLarge', |
||
9 | 'large', |
||
10 | 'medium', |
||
11 | 'small', |
||
12 | 'thumbnail', |
||
13 | 'smallThumbnail', |
||
14 | ]; |
||
15 | |||
16 | /** |
||
17 | * Provide a shortcut to the data in 'volumeInfo', so we can do e.g. |
||
18 | * `$volume->title` instead of `$volume->volumeInfo->title`. |
||
19 | * |
||
20 | * @param string $key |
||
21 | * @return mixed |
||
22 | */ |
||
23 | public function __get($key) |
||
27 | |||
28 | /** |
||
29 | * Get the URL to the largest available cover, but no larger than $preferredSize. |
||
30 | * |
||
31 | * @param string $preferredSize |
||
32 | * @return string|null |
||
33 | */ |
||
34 | public function getCover($preferredSize = 'extraLarge') |
||
62 | |||
63 | /** |
||
64 | * Modify the cover URL to remove the cover edge. |
||
65 | * |
||
66 | * @param string $url |
||
67 | * @return string |
||
68 | */ |
||
69 | protected function removeCoverEdge($url) |
||
76 | } |
||
77 |