UserType
extends UserType
in package
Admin variant of a user type (`cms_system_user_types`), hydrated from the Api endpoint `api/system/user-type` via `ApiBridge`; maps translations (name).
Tags
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_system_user_types'
- #[TableAlias]
- 'userType'
Table of Contents
Properties
- $id : int|null
- $requiresCompanyData : bool
- $requiresVatId : bool
- $translations : Collection
Methods
- __construct() : mixed
- addTranslation() : $this
- callInitMethods() : void
- Calls `init{TraitName}()` for every used trait that defines such a method.
- getAllTraits() : array<string, string>
- Returns all traits the class uses, including those used by parent classes and nested traits.
- getId() : int|null
- getRequiresCompanyData() : bool
- getRequiresVatId() : bool
- getTranslation() : TTranslation|null
- getTranslations() : Collection<int, TTranslation>
- isPersisted() : bool
- isRequiresCompanyData() : bool
- isRequiresVatId() : bool
- removeTranslation() : $this
- requiresCompanyData() : bool
- requiresVatId() : bool
- setId() : $this
- setRequiresCompanyData() : TTranslation>
- setRequiresVatId() : TTranslation>
- setTranslations() : $this
- translationCollectionInit() : void
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'user_type_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$requiresCompanyData
protected
bool
$requiresCompanyData
= false
Attributes
- #[Column]
- $name: 'requires_company_data'
- $type: 'boolean'
$requiresVatId
protected
bool
$requiresVatId
= false
Attributes
- #[Column]
- $name: 'requires_vat_id'
- $type: 'boolean'
$translations
protected
Collection
$translations
Attributes
- #[CollectionOf]
- \App\UI\Admin\System\Models\Entities\UserTypeText::class
- $owned: true
- #[OneToMany]
- $targetEntity: \App\UI\Admin\System\Models\Entities\UserTypeText::class
- $mappedBy: 'parent'
- $cascade: ["persist", "remove"]
- $orphanRemoval: true
- $fetch: "LAZY"
Methods
__construct()
public
__construct([int|null $id = null ][, bool $requiresCompanyData = false ][, bool $requiresVatId = false ][, Collection $translations = new ArrayCollection() ]) : mixed
Parameters
- $id : int|null = null
- $requiresCompanyData : bool = false
- $requiresVatId : bool = false
- $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
getAllTraits()
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>getId()
public
getId() : int|null
Return values
int|nullgetRequiresCompanyData()
public
getRequiresCompanyData() : bool
Return values
boolgetRequiresVatId()
public
getRequiresVatId() : bool
Return values
boolgetTranslation()
public
getTranslation(int $langId) : TTranslation|null
Parameters
- $langId : int
Return values
TTranslation|nullgetTranslations()
public
getTranslations() : Collection<int, TTranslation>
Return values
Collection<int, TTranslation>isPersisted()
public
isPersisted() : bool
Return values
boolisRequiresCompanyData()
public
isRequiresCompanyData() : bool
Return values
boolisRequiresVatId()
public
isRequiresVatId() : bool
Return values
boolremoveTranslation()
public
removeTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thisrequiresCompanyData()
public
requiresCompanyData() : bool
Return values
boolrequiresVatId()
public
requiresVatId() : bool
Return values
boolsetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetRequiresCompanyData()
public
setRequiresCompanyData(bool $requiresCompanyData) : TTranslation>
Parameters
- $requiresCompanyData : bool
Return values
TTranslation>setRequiresVatId()
public
setRequiresVatId(bool $requiresVatId) : TTranslation>
Parameters
- $requiresVatId : bool
Return values
TTranslation>setTranslations()
public
setTranslations(Collection<int, TTranslation>|array<int, TTranslation> $translations) : $this
Parameters
- $translations : Collection<int, TTranslation>|array<int, TTranslation>
Return values
$thistranslationCollectionInit()
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>