SupplyKind
extends SupplyKind
in package
Supply kind (`cms_system_supply_kinds`) — goods, service, electronic service, …
Tags
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_system_supply_kinds'
- #[TableAlias]
- 'supplyKind'
Table of Contents
Properties
- $active : bool
- $id : int|null
- $isDefault : bool
- $key : string
- $nature : string
- $sort : int
- $translations : Collection
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.
- getId() : int|null
- getIsDefault() : bool
- getKey() : string
- getNature() : string
- getNatureEnum() : SupplyNature|null
- getSort() : int
- getTranslation() : TTranslation|null
- getTranslations() : Collection<int, TTranslation>
- isActive() : bool
- isDefault() : bool
- isPersisted() : bool
- removeTranslation() : $this
- setActive() : TTranslation>
- setId() : $this
- setIsDefault() : TTranslation>
- setKey() : TTranslation>
- setNature() : TTranslation>
- setSort() : TTranslation>
- setTranslations() : $this
- 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'
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'supply_kind_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$isDefault
protected
bool
$isDefault
= false
Attributes
- #[Column]
- $name: 'is_default'
- $type: 'boolean'
$key
protected
string
$key
= ''
Attributes
- #[Column]
- $name: '`key`'
- $type: 'string'
- $length: 40
$nature
protected
string
$nature
= SupplyNature::Goods->value
Attributes
- #[Column]
- $name: 'nature'
- $type: 'string'
- $length: 20
$sort
protected
int
$sort
= 0
Attributes
- #[Column]
- $name: 'sort'
- $type: 'integer'
$translations
protected
Collection
$translations
Attributes
- #[OneToMany]
- $targetEntity: \App\UI\Api\System\Models\Entities\SupplyKindText::class
- $mappedBy: 'parent'
- $cascade: ["persist", "remove"]
- $orphanRemoval: true
- $fetch: "LAZY"
Methods
__construct()
public
__construct([int|null $id = null ][, string $key = '' ][, string $nature = SupplyNature::Goods->value ][, int $sort = 0 ][, bool $active = true ][, bool $isDefault = false ][, Collection $translations = new ArrayCollection() ]) : mixed
Parameters
- $id : int|null = null
- $key : string = ''
- $nature : string = SupplyNature::Goods->value
- $sort : int = 0
- $active : bool = true
- $isDefault : 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
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>getId()
public
getId() : int|null
Return values
int|nullgetIsDefault()
public
getIsDefault() : bool
Return values
boolgetKey()
public
getKey() : string
Return values
stringgetNature()
public
getNature() : string
Return values
stringgetNatureEnum()
public
getNatureEnum() : SupplyNature|null
Return values
SupplyNature|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>isActive()
public
isActive() : bool
Return values
boolisDefault()
public
isDefault() : 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>setId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetIsDefault()
public
setIsDefault(bool $isDefault) : TTranslation>
Parameters
- $isDefault : bool
Return values
TTranslation>setKey()
public
setKey(string $key) : TTranslation>
Parameters
- $key : string
Return values
TTranslation>setNature()
public
setNature(string $nature) : TTranslation>
Parameters
- $nature : string
Return values
TTranslation>setSort()
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
$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>