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