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 data in 'volumeInfo', so we can do `$volume->title` |
||
18 | * instead of `$volume->volumeInfo->title`. |
||
19 | * |
||
20 | * @param string $key |
||
21 | * @return mixed |
||
22 | */ |
||
23 | public function __get($key) |
||
27 | |||
28 | /** |
||
29 | * Returns cover of size $preferredSize or smaller if a cover of size $preferredSize does not exist. |
||
30 | * |
||
31 | * @param string $preferredSize |
||
32 | * @return mixed|null |
||
33 | */ |
||
34 | public function getCover($preferredSize='extraLarge') |
||
61 | |||
62 | /** |
||
63 | * Modify the URL to remove the cover edge. |
||
64 | * |
||
65 | * @param string $url |
||
66 | * @return string |
||
67 | */ |
||
68 | protected function removeCoverEdge($url) { |
||
74 | } |
||
75 |