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