ProductSetLink
extends ProductSetLink
in package
Multilingual link (manual, video…): `name` and `value` are per language (see the text entity). Many-to-many to `ProductSet` is mapped on the owning side {@see ProductSet::$links}.
Tags
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_mod_eshop_product_set_links'
- #[TableAlias]
- 'productSetLink'
Table of Contents
Properties
- $id : int|null
- $linkType : TLinkType|null
- $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
- getLinkType() : TLinkType|null
- getTranslation() : TTranslation|null
- getTranslations() : Collection<int, TTranslation>
- isPersisted() : bool
- removeTranslation() : $this
- setId() : $this
- setLinkType() : $this
- 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: 'product_set_link_id'
- $type: 'bigint'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$linkType
protected
TLinkType|null
$linkType
= null
Attributes
- #[EntityOf]
- \App\UI\Admin\Eshop\Models\Entities\ProductSetLinkType::class
- #[JoinColumn]
- $name: 'cms_mod_eshop_product_set_link_types_type_id'
- $referencedColumnName: 'type_id'
- $nullable: true
- $onDelete: 'SET NULL'
- #[ManyToOne]
- $targetEntity: \App\UI\Admin\Eshop\Models\Entities\ProductSetLinkType::class
- $fetch: 'LAZY'
$translations
protected
Collection
$translations
Attributes
- #[CollectionOf]
- \App\UI\Admin\Eshop\Models\Entities\ProductSetLinkText::class
- $owned: true
- #[OneToMany]
- $targetEntity: \App\UI\Admin\Eshop\Models\Entities\ProductSetLinkText::class
- $mappedBy: 'parent'
- $cascade: ['persist', 'remove']
- $orphanRemoval: true
- $fetch: 'LAZY'
Methods
__construct()
public
__construct([int|null $id = null ][, mixed $linkType = null ][, Collection $translations = new ArrayCollection() ]) : mixed
Parameters
- $id : int|null = null
- $linkType : mixed = 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
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|nullgetLinkType()
public
getLinkType() : TLinkType|null
Return values
TLinkType|nullgetTranslation()
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
boolremoveTranslation()
public
removeTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetLinkType()
public
setLinkType(TLinkType|null $linkType) : $this
Parameters
- $linkType : TLinkType|null
Return values
$thissetTranslations()
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>