CoolCMS API

BlacklistedWord extends BlacklistedWord
in package

Admin variant of a blacklisted word (`cms_system_blacklisted_words`), hydrated from `api/system/blacklisted-word`.

The word itself is per language (translations, the value of each language).

Tags
extends
Attributes
#[Entity]
#[Table]
$name: 'cms_system_blacklisted_words'
#[TableAlias]
'blacklistedWord'

Table of Contents

Properties

$active  : bool
$id  : int|null
$translations  : Collection<int, BlacklistedWordText>

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
getTranslation()  : TTranslation|null
getTranslations()  : Collection<int, TTranslation>
isActive()  : bool
isPersisted()  : bool
removeTranslation()  : $this
setActive()  : $this
setId()  : $this
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: 'blacklisted_word_id'
$type: 'integer'
$options: ['unsigned' => true]
#[GeneratedValue]
#[Id]

$translations

protected Collection<int, BlacklistedWordText> $translations
Attributes
#[CollectionOf]
\App\UI\Admin\System\Models\Entities\BlacklistedWordText::class
$owned: true
#[OneToMany]
$targetEntity: \App\UI\Admin\System\Models\Entities\BlacklistedWordText::class
$mappedBy: 'parent'
$cascade: ["persist", "remove"]
$orphanRemoval: true
$fetch: "LAZY"

Methods

__construct()

public __construct([int|null $id = null ][, bool $active = true ][, Collection $translations = new ArrayCollection() ]) : mixed
Parameters
$id : int|null = null
$active : bool = true
$translations : Collection = new ArrayCollection()

addTranslation()

public addTranslation(TTranslation $translation) : $this
Parameters
$translation : TTranslation
Return values
$this

callInitMethods()

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>

getTranslation()

public getTranslation(int $langId) : TTranslation|null
Parameters
$langId : int
Return values
TTranslation|null

getTranslations()

public getTranslations() : Collection<int, TTranslation>
Return values
Collection<int, TTranslation>

removeTranslation()

public removeTranslation(TTranslation $translation) : $this
Parameters
$translation : TTranslation
Return values
$this

setActive()

public setActive(bool $active) : $this
Parameters
$active : bool
Return values
$this

setId()

public setId(int|null $id) : $this
Parameters
$id : int|null
Return values
$this

setTranslations()

public setTranslations(Collection<int, TTranslation>|array<int, TTranslation> $translations) : $this
Parameters
$translations : Collection<int, TTranslation>|array<int, TTranslation>
Return values
$this

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>
Return values
array<string, string>
On this page

Search results