| Total Complexity | 9 |
| Total Lines | 87 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class PictureModel extends MainModel |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Type of info. Either anime or manga. |
||
| 15 | * |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | private $_type; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Id of the anime or manga. |
||
| 22 | * |
||
| 23 | * @var string|int |
||
| 24 | */ |
||
| 25 | private $_id; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Default constructor. |
||
| 29 | * |
||
| 30 | * @param string $type |
||
| 31 | * @param string|int $id |
||
| 32 | * @param string $parserArea |
||
| 33 | * |
||
| 34 | * @return void |
||
| 35 | */ |
||
| 36 | public function __construct($type, $id, $parserArea = '.js-scrollfix-bottom-rel') |
||
| 37 | { |
||
| 38 | $this->_type = $type; |
||
| 39 | $this->_id = $id; |
||
| 40 | $this->_url = $this->_myAnimeListUrl.'/'.$type.'/'.$id; |
||
| 41 | $this->_parserArea = $parserArea; |
||
| 42 | |||
| 43 | parent::errorCheck($this); |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Default call. |
||
| 48 | * |
||
| 49 | * @param string $method |
||
| 50 | * @param array $arguments |
||
| 51 | * |
||
| 52 | * @return array|string|int |
||
| 53 | */ |
||
| 54 | public function __call($method, $arguments) |
||
| 55 | { |
||
| 56 | if ($this->_error) |
||
| 57 | return $this->_error; |
||
| 58 | return call_user_func_array([$this, $method], $arguments); |
||
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * Get type (anime or manga). |
||
| 63 | * |
||
| 64 | * @return string |
||
| 65 | */ |
||
| 66 | private function getType() |
||
| 67 | { |
||
| 68 | return $this->_type; |
||
| 69 | } |
||
| 70 | |||
| 71 | /** |
||
| 72 | * Get anime/manga id. |
||
| 73 | * |
||
| 74 | * @return string |
||
| 75 | */ |
||
| 76 | private function getId() |
||
| 77 | { |
||
| 78 | return $this->_id; |
||
| 79 | } |
||
| 80 | |||
| 81 | /** |
||
| 82 | * Get anime/manga additional pictures. |
||
| 83 | * |
||
| 84 | * @return array |
||
| 85 | */ |
||
| 86 | private function getAllInfo() |
||
| 98 | } |
||
| 99 | } |