| Total Complexity | 7 |
| Total Lines | 91 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class Subdivision |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var string |
||
| 11 | */ |
||
| 12 | private $name; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var string |
||
| 16 | */ |
||
| 17 | private $localName; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | private $code; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var string |
||
| 26 | */ |
||
| 27 | private $type; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @var string|null |
||
| 31 | */ |
||
| 32 | private $parent; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Subdivision constructor. |
||
| 36 | * @param string $name |
||
| 37 | * @param string $code |
||
| 38 | * @param string $type |
||
| 39 | * @param string|null $parent |
||
| 40 | */ |
||
| 41 | public function __construct( |
||
| 42 | $name, |
||
| 43 | $code, |
||
| 44 | $type, |
||
| 45 | $parent = null |
||
| 46 | ) { |
||
| 47 | $this->name = $name; |
||
| 48 | $this->code = $code; |
||
| 49 | $this->type = $type; |
||
| 50 | $this->parent = $parent; |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @return string |
||
| 55 | */ |
||
| 56 | public function getName() |
||
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @return string |
||
| 63 | */ |
||
| 64 | public function getLocalName() |
||
| 65 | { |
||
| 66 | if ($this->localName === null) { |
||
| 67 | $this->localName = dgettext( |
||
| 68 | Subdivisions::getISONumber(), |
||
| 69 | $this->name |
||
| 70 | ); |
||
| 71 | } |
||
| 72 | |||
| 73 | return $this->localName; |
||
| 74 | } |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @return string |
||
| 78 | */ |
||
| 79 | public function getCode() |
||
| 80 | { |
||
| 81 | return $this->code; |
||
| 82 | } |
||
| 83 | |||
| 84 | /** |
||
| 85 | * @return string |
||
| 86 | */ |
||
| 87 | public function getType() |
||
| 88 | { |
||
| 89 | return $this->type; |
||
| 90 | } |
||
| 91 | |||
| 92 | /** |
||
| 93 | * @return string|null |
||
| 94 | */ |
||
| 95 | public function getParent() |
||
| 98 | } |
||
| 99 | } |
||
| 100 |