Country
extends Country
in package
Country (`cms_system_countries`) — ISO 3166-1 alpha-2 code, VAT id prefix, EU membership.
Tags
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_system_countries'
- #[TableAlias]
- 'country'
Table of Contents
Properties
- $active : bool
- $countryCode : string
- $euMember : bool
- $euMemberSince : DateTime|null
- $euMemberUntil : DateTime|null
- $id : int|null
- $sort : int
- $translations : Collection
- $vatPrefix : string
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.
- getCountryCode() : string
- getEuMember() : bool
- getEuMemberSince() : DateTime|null
- getEuMemberUntil() : DateTime|null
- getId() : int|null
- getSort() : int
- getTranslation() : TTranslation|null
- getTranslations() : Collection<int, TTranslation>
- getVatPrefix() : string
- isActive() : bool
- isEuMember() : bool
- isPersisted() : bool
- removeTranslation() : $this
- setActive() : TTranslation>
- setCountryCode() : TTranslation>
- setEuMember() : TTranslation>
- setEuMemberSince() : TTranslation>
- setEuMemberUntil() : TTranslation>
- setId() : $this
- setSort() : TTranslation>
- setTranslations() : $this
- setVatPrefix() : TTranslation>
- 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'
$countryCode
protected
string
$countryCode
= ''
Attributes
- #[Column]
- $name: 'country_code'
- $type: 'string'
- $length: 2
- $options: ['fixed' => true]
$euMember
protected
bool
$euMember
= false
Attributes
- #[Column]
- $name: 'eu_member'
- $type: 'boolean'
$euMemberSince
protected
DateTime|null
$euMemberSince
= null
Attributes
- #[Column]
- $name: 'eu_member_since'
- $type: 'date'
- $nullable: true
$euMemberUntil
protected
DateTime|null
$euMemberUntil
= null
Attributes
- #[Column]
- $name: 'eu_member_until'
- $type: 'date'
- $nullable: true
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'country_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$sort
protected
int
$sort
= 0
Attributes
- #[Column]
- $name: 'sort'
- $type: 'integer'
$translations
protected
Collection
$translations
Attributes
- #[CollectionOf]
- \App\UI\Admin\System\Models\Entities\CountryText::class
- $owned: true
- #[OneToMany]
- $targetEntity: \App\UI\Admin\System\Models\Entities\CountryText::class
- $mappedBy: 'parent'
- $cascade: ["persist", "remove"]
- $orphanRemoval: true
- $fetch: "LAZY"
$vatPrefix
protected
string
$vatPrefix
= ''
Attributes
- #[Column]
- $name: 'vat_prefix'
- $type: 'string'
- $length: 2
- $options: ['fixed' => true]
Methods
__construct()
public
__construct([int|null $id = null ][, string $countryCode = '' ][, string $vatPrefix = '' ][, bool $euMember = false ][, DateTime|null $euMemberSince = null ][, DateTime|null $euMemberUntil = null ][, bool $active = true ][, int $sort = 0 ][, Collection $translations = new ArrayCollection() ]) : mixed
Parameters
- $id : int|null = null
- $countryCode : string = ''
- $vatPrefix : string = ''
- $euMember : bool = false
- $euMemberSince : DateTime|null = null
- $euMemberUntil : DateTime|null = null
- $active : bool = true
- $sort : int = 0
- $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>getCountryCode()
public
getCountryCode() : string
Return values
stringgetEuMember()
public
getEuMember() : bool
Return values
boolgetEuMemberSince()
public
getEuMemberSince() : DateTime|null
Return values
DateTime|nullgetEuMemberUntil()
public
getEuMemberUntil() : DateTime|null
Return values
DateTime|nullgetId()
public
getId() : int|null
Return values
int|nullgetSort()
public
getSort() : 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>getVatPrefix()
public
getVatPrefix() : string
Return values
stringisActive()
public
isActive() : bool
Return values
boolisEuMember()
public
isEuMember() : 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) : TTranslation>
Parameters
- $active : bool
Return values
TTranslation>setCountryCode()
public
setCountryCode(string $countryCode) : TTranslation>
Parameters
- $countryCode : string
Return values
TTranslation>setEuMember()
public
setEuMember(bool $euMember) : TTranslation>
Parameters
- $euMember : bool
Return values
TTranslation>setEuMemberSince()
public
setEuMemberSince(DateTime|null $euMemberSince) : TTranslation>
Parameters
- $euMemberSince : DateTime|null
Return values
TTranslation>setEuMemberUntil()
public
setEuMemberUntil(DateTime|null $euMemberUntil) : TTranslation>
Parameters
- $euMemberUntil : DateTime|null
Return values
TTranslation>setId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetSort()
public
setSort(int $sort) : TTranslation>
Parameters
- $sort : int
Return values
TTranslation>setTranslations()
public
setTranslations(Collection<int, TTranslation>|array<int, TTranslation> $translations) : $this
Parameters
- $translations : Collection<int, TTranslation>|array<int, TTranslation>
Return values
$thissetVatPrefix()
public
setVatPrefix(string $vatPrefix) : TTranslation>
Parameters
- $vatPrefix : string
Return values
TTranslation>translationCollectionInit()
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>