| Total Complexity | 7 |
| Total Lines | 63 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class Countries extends AbstractDatabase |
||
| 9 | { |
||
| 10 | public static function getISONumber() |
||
| 13 | } |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @param array $entry |
||
| 17 | * |
||
| 18 | * @return Country |
||
| 19 | */ |
||
| 20 | protected function arrayToEntry(array $entry) |
||
| 21 | { |
||
| 22 | return new Country( |
||
| 23 | $entry['name'], |
||
| 24 | $entry['alpha_2'], |
||
| 25 | $entry['alpha_3'], |
||
| 26 | (int)$entry['numeric'], |
||
| 27 | !empty($entry['official_name']) ? $entry['official_name'] : null |
||
| 28 | ); |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @return array |
||
| 33 | */ |
||
| 34 | protected function getIndexDefinition() |
||
| 40 | ]; |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @param string $alpha2 |
||
| 45 | * |
||
| 46 | * @return null|Country |
||
| 47 | */ |
||
| 48 | public function getByAlpha2($alpha2) |
||
| 49 | { |
||
| 50 | return $this->find('alpha_2', $alpha2); |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @param string $alpha3 |
||
| 55 | * |
||
| 56 | * @return null|Country |
||
| 57 | */ |
||
| 58 | public function getByAlpha3($alpha3) |
||
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * @param int $code |
||
| 65 | * |
||
| 66 | * @return null|Country |
||
| 67 | */ |
||
| 68 | public function getByNumericCode($code) |
||
| 71 | } |
||
| 72 | } |
||
| 73 |