| Total Complexity | 6 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class Subdivisions extends AbstractDatabase |
||
| 9 | { |
||
| 10 | public static function getISONumber() |
||
| 13 | } |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @param array $entry |
||
| 17 | * |
||
| 18 | * @return Subdivision |
||
| 19 | */ |
||
| 20 | protected function arrayToEntry(array $entry) |
||
| 21 | { |
||
| 22 | return new Subdivision( |
||
| 23 | $entry['name'], |
||
| 24 | $entry['code'], |
||
| 25 | $entry['type'], |
||
| 26 | !empty($entry['parent']) ? $entry['parent'] : null |
||
| 27 | ); |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @return array |
||
| 32 | */ |
||
| 33 | protected function getIndexDefinition() |
||
| 34 | { |
||
| 35 | return [ |
||
| 36 | 'code', |
||
| 37 | 'country_code' => [['code', 2], 'code'], |
||
| 38 | ]; |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @param $code |
||
| 43 | * @return Subdivision |
||
| 44 | */ |
||
| 45 | public function getByCode($code) |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @param $code |
||
| 52 | * @return Subdivision[] |
||
| 53 | */ |
||
| 54 | public function getAllByCountryCode($code) |
||
| 59 |