ProductTag
extends ProductTag
in package
Product tag (badge). `attributeClass` is the CSS class of the badge (appearance only).
Tags
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_mod_eshop_product_tags'
- #[TableAlias]
- 'productTag'
Table of Contents
Properties
- $attributeClass : string|null
- $id : int|null
- $newFlag : bool
- $recommendedFlag : bool
- $saleFlag : 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.
- getAttributeClass() : string|null
- getId() : int|null
- getNewFlag() : bool
- getRecommendedFlag() : bool
- getSaleFlag() : bool
- getTranslation() : TTranslation|null
- getTranslations() : Collection<int, TTranslation>
- isNewFlag() : bool
- isPersisted() : bool
- isRecommendedFlag() : bool
- isSaleFlag() : bool
- removeTranslation() : $this
- setAttributeClass() : $this
- setId() : $this
- setNewFlag() : $this
- setRecommendedFlag() : $this
- setSaleFlag() : $this
- setTranslations() : $this
- translationCollectionInit() : void
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$attributeClass
protected
string|null
$attributeClass
= null
Attributes
- #[Column]
- $name: 'attribute_class'
- $type: 'string'
- $length: 15
- $nullable: true
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'tag_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$newFlag
protected
bool
$newFlag
= false
Attributes
- #[Column]
- $name: 'new_flag'
- $type: 'boolean'
$recommendedFlag
protected
bool
$recommendedFlag
= false
Attributes
- #[Column]
- $name: 'recommended_flag'
- $type: 'boolean'
$saleFlag
protected
bool
$saleFlag
= false
Attributes
- #[Column]
- $name: 'sale_flag'
- $type: 'boolean'
$translations
protected
Collection
$translations
Attributes
- #[CollectionOf]
- \App\UI\Front\Eshop\Models\Entities\ProductTagText::class
- $owned: true
- #[OneToMany]
- $targetEntity: \App\UI\Front\Eshop\Models\Entities\ProductTagText::class
- $mappedBy: 'parent'
- $cascade: ['persist', 'remove']
- $orphanRemoval: true
- $fetch: 'LAZY'
Methods
__construct()
public
__construct([int|null $id = null ][, string|null $attributeClass = null ][, bool $saleFlag = false ][, bool $recommendedFlag = false ][, bool $newFlag = false ][, Collection $translations = new ArrayCollection() ]) : mixed
Parameters
- $id : int|null = null
- $attributeClass : string|null = null
- $saleFlag : bool = false
- $recommendedFlag : bool = false
- $newFlag : 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>getAttributeClass()
public
getAttributeClass() : string|null
Return values
string|nullgetId()
public
getId() : int|null
Return values
int|nullgetNewFlag()
public
getNewFlag() : bool
Return values
boolgetRecommendedFlag()
public
getRecommendedFlag() : bool
Return values
boolgetSaleFlag()
public
getSaleFlag() : 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>isNewFlag()
public
isNewFlag() : bool
Return values
boolisPersisted()
public
isPersisted() : bool
Return values
boolisRecommendedFlag()
public
isRecommendedFlag() : bool
Return values
boolisSaleFlag()
public
isSaleFlag() : bool
Return values
boolremoveTranslation()
public
removeTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thissetAttributeClass()
public
setAttributeClass(string|null $attributeClass) : $this
Parameters
- $attributeClass : string|null
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetNewFlag()
public
setNewFlag(bool $newFlag) : $this
Parameters
- $newFlag : bool
Return values
$thissetRecommendedFlag()
public
setRecommendedFlag(bool $recommendedFlag) : $this
Parameters
- $recommendedFlag : bool
Return values
$thissetSaleFlag()
public
setSaleFlag(bool $saleFlag) : $this
Parameters
- $saleFlag : bool
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>