Region
extends Region
in package
Region is a nested-set tree (`parent_id` + `lft`/`rgt`/`level`), hence the {@see TreeNodeInterface} marker: without it the generic insert gate in {@see \App\Core\Traits\Api\Models\Managers\SaveTrait} did not run and a new region stayed at `lft=0, rgt=0`. The region manager, service, mapper and repository have the tree traits, so the gate has something to call.
Tags
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_system_regions'
- #[TableAlias]
- 'region'
Table of Contents
Properties
- $active : bool
- $assetPath : string|null
- $countryCode : string|null
- $geonameId : int|null
- $iconClass : string|null
- $id : int|null
- $imageId : int|null
- $isCountry : bool
- $key : string|null
- $latitude : string|null
- $level : int
- $lft : int
- $longitude : string|null
- $main : bool
- $nameAscii : string|null
- $officialCode : string|null
- $parentId : int|null
- $population : int|null
- $postcode : string|null
- $rgt : int
- $suggestWeight : int
- $translations : Collection
- $type : string|null
- $assetFile : FtpAsset|null
- Transient cache of the derived `FtpAsset` (not a database column).
Methods
- __construct() : mixed
- addTranslation() : $this
- callInitMethods() : void
- Calls `init{TraitName}()` for every used trait that defines such a method.
- getActive() : bool
- getAllTraits() : array<string, string>
- Returns all traits the class uses, including those used by parent classes and nested traits.
- getAssetFile() : FtpAsset|null
- Returns the `FtpAsset` derived from the path (lazy, works after Doctrine hydration too).
- getAssetPath() : string|null
- getCountryCode() : string|null
- getGeonameId() : int|null
- getIconClass() : string|null
- getId() : int|null
- getImageId() : int|null
- getIsCountry() : bool
- getKey() : string|null
- getLatitude() : string|null
- getLevel() : int
- getLft() : int
- getLongitude() : string|null
- getMain() : bool
- getNameAscii() : string|null
- getOfficialCode() : string|null
- getParentId() : int|null
- getPopulation() : int|null
- getPostcode() : string|null
- getRgt() : int
- getSuggestWeight() : int
- getTranslation() : TTranslation|null
- getTranslations() : Collection<int, TTranslation>
- getType() : string|null
- isActive() : bool
- isCountry() : bool
- isMain() : bool
- isPersisted() : bool
- removeTranslation() : $this
- setActive() : $this
- setAssetPath() : $this
- setCountryCode() : static
- setGeonameId() : static
- setIconClass() : $this
- setId() : $this
- setImageId() : $this
- setIsCountry() : $this
- setKey() : $this
- setLatitude() : $this
- setLevel() : $this
- setLft() : $this
- setLongitude() : $this
- setMain() : $this
- setNameAscii() : static
- setOfficialCode() : static
- setParentId() : $this
- setPopulation() : static
- setPostcode() : $this
- setRgt() : $this
- setSuggestWeight() : static
- setTranslations() : $this
- setType() : static
- translationCollectionInit() : void
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$active
protected
bool
$active
= true
Attributes
- #[Column]
- $name: 'active'
- $type: 'boolean'
$assetPath
protected
string|null
$assetPath
= null
Attributes
- #[Column]
- $name: 'asset_path'
- $type: 'string'
- $length: 255
- $nullable: true
$countryCode
protected
string|null
$countryCode
= null
Attributes
- #[Column]
- $name: 'country_code'
- $type: 'string'
- $length: 2
- $nullable: true
- $options: ['fixed' => true]
$geonameId
protected
int|null
$geonameId
= null
Attributes
- #[Column]
- $name: 'geoname_id'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
$iconClass
protected
string|null
$iconClass
= null
Attributes
- #[Column]
- $name: 'icon_class'
- $type: 'string'
- $length: 50
- $nullable: true
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'region_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$imageId
protected
int|null
$imageId
= null
Attributes
- #[Column]
- $name: 'cms_system_images_image_id'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
$isCountry
protected
bool
$isCountry
= false
Attributes
- #[Column]
- $name: 'is_country'
- $type: 'boolean'
$key
protected
string|null
$key
= null
Attributes
- #[Column]
- $name: '`key`'
- $type: 'string'
- $length: 5
- $nullable: true
$latitude
protected
string|null
$latitude
= null
Attributes
- #[Column]
- $name: 'latitude'
- $type: 'decimal'
- $precision: 9
- $scale: 6
- $nullable: true
$level
protected
int
$level
= 1
Attributes
- #[Column]
- $name: 'level'
- $type: 'integer'
- $options: ['unsigned' => true]
$lft
protected
int
$lft
= 0
Attributes
- #[Column]
- $name: 'lft'
- $type: 'integer'
- $options: ['unsigned' => true]
$longitude
protected
string|null
$longitude
= null
Attributes
- #[Column]
- $name: 'longitude'
- $type: 'decimal'
- $precision: 9
- $scale: 6
- $nullable: true
$main
protected
bool
$main
= false
Attributes
- #[Column]
- $name: 'main'
- $type: 'boolean'
$nameAscii
protected
string|null
$nameAscii
= null
Attributes
- #[Column]
- $name: 'name_ascii'
- $type: 'string'
- $length: 200
- $nullable: true
$officialCode
protected
string|null
$officialCode
= null
Attributes
- #[Column]
- $name: 'official_code'
- $type: 'string'
- $length: 20
- $nullable: true
$parentId
protected
int|null
$parentId
= null
Attributes
- #[Column]
- $name: 'parent_id'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
$population
protected
int|null
$population
= null
Attributes
- #[Column]
- $name: 'population'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
$postcode
protected
string|null
$postcode
= null
Attributes
- #[Column]
- $name: 'postcode'
- $type: 'string'
- $length: 20
- $nullable: true
$rgt
protected
int
$rgt
= 0
Attributes
- #[Column]
- $name: 'rgt'
- $type: 'integer'
- $options: ['unsigned' => true]
$suggestWeight
protected
int
$suggestWeight
= 0
Attributes
- #[Column]
- $name: 'suggest_weight'
- $type: 'integer'
- $options: ['unsigned' => true, 'default' => 0]
$translations
protected
Collection
$translations
Attributes
- #[OneToMany]
- $targetEntity: \App\UI\Api\System\Models\Entities\RegionText::class
- $mappedBy: 'parent'
- $cascade: ["persist", "remove"]
- $orphanRemoval: true
- $fetch: "LAZY"
$type
protected
string|null
$type
= null
Attributes
- #[Column]
- $name: 'type'
- $type: 'string'
- $length: 20
- $nullable: true
$assetFile
Transient cache of the derived `FtpAsset` (not a database column).
private
FtpAsset|null
$assetFile
= null
Attributes
- #[Transient]
Methods
__construct()
public
__construct([int|null $id = null ][, bool $isCountry = false ][, string|null $key = null ][, string|null $countryCode = null ][, string|null $type = null ][, int|null $geonameId = null ][, string|null $officialCode = null ][, string|null $nameAscii = null ][, int|null $population = null ][, int $suggestWeight = 0 ][, bool $main = false ][, bool $active = true ][, int|null $parentId = null ][, int $level = 1 ][, int $lft = 0 ][, int $rgt = 0 ][, string|null $iconClass = null ][, int|null $imageId = null ][, string|null $assetPath = null ][, string|null $postcode = null ][, string|null $latitude = null ][, string|null $longitude = null ][, Collection $translations = new ArrayCollection() ]) : mixed
Parameters
- $id : int|null = null
- $isCountry : bool = false
- $key : string|null = null
- $countryCode : string|null = null
- $type : string|null = null
- $geonameId : int|null = null
- $officialCode : string|null = null
- $nameAscii : string|null = null
- $population : int|null = null
- $suggestWeight : int = 0
- $main : bool = false
- $active : bool = true
- $parentId : int|null = null
- $level : int = 1
- $lft : int = 0
- $rgt : int = 0
- $iconClass : string|null = null
- $imageId : int|null = null
- $assetPath : string|null = null
- $postcode : string|null = null
- $latitude : string|null = null
- $longitude : string|null = null
- $translations : Collection = new ArrayCollection()
addTranslation()
public
addTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thiscallInitMethods()
Calls `init{TraitName}()` for every used trait that defines such a method.
public
callInitMethods() : void
getActive()
public
getActive() : bool
Return values
boolgetAllTraits()
Returns all traits the class uses, including those used by parent classes and nested traits.
public
getAllTraits() : array<string, string>
Return values
array<string, string>getAssetFile()
Returns the `FtpAsset` derived from the path (lazy, works after Doctrine hydration too).
public
getAssetFile() : FtpAsset|null
Return values
FtpAsset|nullgetAssetPath()
public
getAssetPath() : string|null
Return values
string|nullgetCountryCode()
public
getCountryCode() : string|null
Return values
string|nullgetGeonameId()
public
getGeonameId() : int|null
Return values
int|nullgetIconClass()
public
getIconClass() : string|null
Return values
string|nullgetId()
public
getId() : int|null
Return values
int|nullgetImageId()
public
getImageId() : int|null
Return values
int|nullgetIsCountry()
public
getIsCountry() : bool
Return values
boolgetKey()
public
getKey() : string|null
Return values
string|nullgetLatitude()
public
getLatitude() : string|null
Return values
string|nullgetLevel()
public
getLevel() : int
Return values
intgetLft()
public
getLft() : int
Return values
intgetLongitude()
public
getLongitude() : string|null
Return values
string|nullgetMain()
public
getMain() : bool
Return values
boolgetNameAscii()
public
getNameAscii() : string|null
Return values
string|nullgetOfficialCode()
public
getOfficialCode() : string|null
Return values
string|nullgetParentId()
public
getParentId() : int|null
Return values
int|nullgetPopulation()
public
getPopulation() : int|null
Return values
int|nullgetPostcode()
public
getPostcode() : string|null
Return values
string|nullgetRgt()
public
getRgt() : int
Return values
intgetSuggestWeight()
public
getSuggestWeight() : int
Return values
intgetTranslation()
public
getTranslation(int $langId) : TTranslation|null
Parameters
- $langId : int
Return values
TTranslation|nullgetTranslations()
public
getTranslations() : Collection<int, TTranslation>
Return values
Collection<int, TTranslation>getType()
public
getType() : string|null
Return values
string|nullisActive()
public
isActive() : bool
Return values
boolisCountry()
public
isCountry() : bool
Return values
boolisMain()
public
isMain() : bool
Return values
boolisPersisted()
public
isPersisted() : bool
Return values
boolremoveTranslation()
public
removeTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thissetActive()
public
setActive(bool $active) : $this
Parameters
- $active : bool
Return values
$thissetAssetPath()
public
setAssetPath(string|null $assetPath) : $this
Parameters
- $assetPath : string|null
Return values
$thissetCountryCode()
public
setCountryCode(string|null $countryCode) : static
Parameters
- $countryCode : string|null
Return values
staticsetGeonameId()
public
setGeonameId(int|null $geonameId) : static
Parameters
- $geonameId : int|null
Return values
staticsetIconClass()
public
setIconClass(string|null $iconClass) : $this
Parameters
- $iconClass : string|null
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetImageId()
public
setImageId(int|null $imageId) : $this
Parameters
- $imageId : int|null
Return values
$thissetIsCountry()
public
setIsCountry(bool $isCountry) : $this
Parameters
- $isCountry : bool
Return values
$thissetKey()
public
setKey(string|null $key) : $this
Parameters
- $key : string|null
Return values
$thissetLatitude()
public
setLatitude(string|null $latitude) : $this
Parameters
- $latitude : string|null
Return values
$thissetLevel()
public
setLevel(int $level) : $this
Parameters
- $level : int
Return values
$thissetLft()
public
setLft(int $lft) : $this
Parameters
- $lft : int
Return values
$thissetLongitude()
public
setLongitude(string|null $longitude) : $this
Parameters
- $longitude : string|null
Return values
$thissetMain()
public
setMain(bool $main) : $this
Parameters
- $main : bool
Return values
$thissetNameAscii()
public
setNameAscii(string|null $nameAscii) : static
Parameters
- $nameAscii : string|null
Return values
staticsetOfficialCode()
public
setOfficialCode(string|null $officialCode) : static
Parameters
- $officialCode : string|null
Return values
staticsetParentId()
public
setParentId(int|null $parentId) : $this
Parameters
- $parentId : int|null
Return values
$thissetPopulation()
public
setPopulation(int|null $population) : static
Parameters
- $population : int|null
Return values
staticsetPostcode()
public
setPostcode(string|null $postcode) : $this
Parameters
- $postcode : string|null
Return values
$thissetRgt()
public
setRgt(int $rgt) : $this
Parameters
- $rgt : int
Return values
$thissetSuggestWeight()
public
setSuggestWeight(int $suggestWeight) : static
Parameters
- $suggestWeight : int
Return values
staticsetTranslations()
public
setTranslations(Collection<int, TTranslation>|array<int, TTranslation> $translations) : $this
Parameters
- $translations : Collection<int, TTranslation>|array<int, TTranslation>
Return values
$thissetType()
public
setType(string|null $type) : static
Parameters
- $type : string|null
Return values
statictranslationCollectionInit()
public
translationCollectionInit() : void
getTraitsRecursive()
Walks the trait list recursively and collects nested traits too.
private
static getTraitsRecursive(array<string, string> $traits) : array<string, string>
Parameters
- $traits : array<string, string>