for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Sokil\IsoCodes\Database\Subdivisions;
use Sokil\IsoCodes\Database\Subdivisions;
class Subdivision
{
/**
* @var string
*/
private $name;
private $localName;
private $code;
private $type;
* @var string|null
private $parent;
* Subdivision constructor.
* @param string $name
* @param string $code
* @param string $type
* @param string|null $parent
public function __construct(
$name,
$code,
$type,
$parent = null
) {
$this->name = $name;
$this->code = $code;
$this->type = $type;
$this->parent = $parent;
}
* @return string
public function getName()
return $this->name;
public function getLocalName()
if ($this->localName === null) {
$this->localName = dgettext(
Subdivisions::getISONumber(),
$this->name
);
return $this->localName;
public function getCode()
return $this->code;
public function getType()
return $this->type;
* @return string|null
public function getParent()
return $this->parent;