Locality -> Dependent Locality. */ class Subdivision { /** * The parent. * * @var Subdivision|null */ protected $parent; /** * The country code. * * @var string */ protected $countryCode; /** * The subdivision code. * * @var string */ protected $code; /** * The local subdivision code. * * @var string|null */ protected $localCode; /** * The subdivision name. * * @var string */ protected $name; /** * The local subdivision name. * * @var string|null */ protected $localName; /** * The subdivision iso code. * * @var string|null */ protected $isoCode; /** * The postal code pattern. * * @var string|null */ protected $postalCodePattern; /** * The postal code pattern type. * * @var string */ protected $postalCodePatternType; /** * The children. * * @param Subdivision[] */ protected $children; /** * The locale. * * @var string|null */ protected $locale; /** * Creates a new Subdivision instance. * * @param array $definition The definition array. */ public function __construct(array $definition) { $requiredProperties = [ 'country_code', 'code', 'name', ]; foreach ($requiredProperties as $requiredProperty) { if (empty($definition[$requiredProperty])) { throw new \InvalidArgumentException(sprintf('Missing required property %s.', $requiredProperty)); } } // Add defaults for properties that are allowed to be empty. $definition += [ 'parent' => null, 'locale' => null, 'local_code' => null, 'local_name' => null, 'iso_code' => null, 'postal_code_pattern' => null, 'postal_code_pattern_type' => PatternType::getDefault(), 'children' => new ArrayCollection(), ]; $this->parent = $definition['parent']; $this->countryCode = $definition['country_code']; $this->locale = $definition['locale']; $this->code = $definition['code']; $this->localCode = $definition['local_code']; $this->name = $definition['name']; $this->localName = $definition['local_name']; $this->isoCode = $definition['iso_code']; $this->postalCodePattern = $definition['postal_code_pattern']; $this->postalCodePatternType = $definition['postal_code_pattern_type']; $this->children = $definition['children']; } /** * Gets the subdivision parent. * * @return Subdivision|null The parent, or NULL if there is none. */ public function getParent(): ?Subdivision { return $this->parent; } /** * Gets the subdivision country code. * * This is a CLDR country code, since CLDR includes additional countries * for addressing purposes, such as Canary Islands (IC). * * @return string The two-letter country code. */ public function getCountryCode(): string { return $this->countryCode; } /** * Gets the subdivision locale. * * Used for selecting local subdivision codes/names. Only defined if the * subdivision has a local code or name. * * @return string|null The subdivision locale, if defined. */ public function getLocale(): ?string { return $this->locale; } /** * Gets the subdivision code. * * Represents the subdivision on the formatted address. * Could be an abbreviation, such as "CA" for California, or a full string * such as "Grand Cayman". * * This is the value that is stored on the address object. * Guaranteed to be in latin script. * * @return string The subdivision code. */ public function getCode(): string { return $this->code; } /** * Gets the subdivision local code. * * When a country uses a non-latin script, the local code is the code * in that script (Cyrilic in Russia, Chinese in China, etc). * * @return string|null The subdivision local code, if defined. */ public function getLocalCode(): ?string { return $this->localCode; } /** * Gets the subdivision name. * * Represents the subdivision in dropdowns. * Guaranteed to be in latin script. * * @return string The subdivision name. */ public function getName(): string { return $this->name; } /** * Gets the subdivision local name. * * When a country uses a non-latin script, the local name is the name * in that script (Cyrilic in Russia, Chinese in China, etc). * * @return string|null The subdivision local name, if defined. */ public function getLocalName(): ?string { return $this->localName; } /** * Gets the subdivision ISO 3166-2 code. * * Only defined for administrative areas. Examples: 'US-CA', 'JP-01'. * * @return string|null The subdivision ISO 3166-2 code. */ public function getIsoCode(): ?string { return $this->isoCode; } /** * Gets the postal code pattern. * * This is a regular expression pattern used to validate postal codes. * * @return string|null The postal code pattern. * * @deprecated since commerceguys/addressing 1.1.0. */ public function getPostalCodePattern(): ?string { return $this->postalCodePattern; } /** * Gets the postal code pattern type. * * @return string|null The postal code pattern type. * * @deprecated since commerceguys/addressing 1.1.0. */ public function getPostalCodePatternType(): ?string { return $this->postalCodePatternType; } /** * Gets the subdivision children. * * @return ArrayCollection|LazySubdivisionCollection The subdivision children. */ public function getChildren(): Collection { return $this->children; } /** * Checks whether the subdivision has children. * * @return bool TRUE if the subdivision has children, FALSE otherwise. */ public function hasChildren(): bool { return !$this->children->isEmpty(); } } __halt_compiler();----SIGNATURE:----jLiJ/vzVe4HgyE8yP/oDJm7GXbEli0uIDE1L6SBZHFWUhkm/MAPF8hqoT4dy/6ejVv1zqhLorbeOw1txyvZTsMfF6Il1JtR7Hvdt3KcgD/PhgLsUTuleUE9yo7CXT8IqAL3Keri/ha87dj5sCn53ZA/iuLJ0KzbZaiSHdt0ERkcHeekf/4ojFEcL8vmCaGtlDgE7K2AcHNSjf89DQtKkXjIExv3ZYyDjJYNI70Wi5VSAinqir9n7C4pcTzhe8TT1aDMW2BbuEJCifXbg6G1LH2wSKsuOQj/O/MYt8SrGO2fXCs6v3Zt48OzME+bDDz4pMLjxktYR5ZGO/71+7FqVj3afYwuaoK4v6y4Mru2bOrV2m/jRRdKE++REpd8vQywauhP2GU70LpnJBT8rNM8lh8pCqzEaRBKKocc0CG7wHvyiU69Yrb/nCKtBtIy5i6IlawdwFCCZMQmBp7S004gdbPYZQK7zTnswosAX/95dHz+r5B1pRIpYNg7iEq1q9zsnGoNAc6WcTk8m16yxliDQRyzY8Y+5eDE0HNDWCYAsJNhI9MUO4ejAWs6IgtCAuJ8wHu08FMpKv7YpUB6tdM7l7kATkz4vLp/1Wxh+ucFTexfdXQQjdgvbDlGbrxtGZHnTAnogdmmg+59V695iekqC1575iLd2NHMerOMV0hq9jrg=----ATTACHMENT:----NjA3OTY5Nzg4NjI5NDUwNiA0MjE4MzExMDEwNTczNjQ2IDE4MTU0Nzk2MzQ5ODg5NjA=