CoolCMS API

AdvertPlace extends AdvertPlace
in package
uses AdvertCollectionTrait

Admin variant of an advert place (`cms_mod_base_advert_places`), hydrated from the `api/base/advert-place` endpoint.

Translations (name and title) are in translations. adverts is the second owning side of the join table cms_mod_base_advert_place_relations (the first is Advert::$places, with the columns swapped).

Tags
extends
Attributes
#[Entity]
#[Table]
$name: 'cms_mod_base_advert_places'
#[TableAlias]
'advertPlace'

Table of Contents

Properties

$activated  : bool
$advertRels  : Collection<int, AdvertPlaceRel>
$attributeClass  : string|null
$attributeId  : string|null
$height  : string|null
$id  : int|null
$translations  : Collection
$width  : string|null

Methods

__construct()  : mixed
addAdvertRel()  : $this
addTranslation()  : $this
callInitMethods()  : void
Calls `init{TraitName}()` for every used trait that defines such a method.
getActivated()  : bool
getAdvertRels()  : Collection<int, TRel>
getAdverts()  : Collection<int, TAdvert>
Returns the linked adverts, extracted from `advertRels`.
getAllTraits()  : array<string, string>
Returns all traits the class uses, including those used by parent classes and nested traits.
getAttributeClass()  : string|null
getAttributeId()  : string|null
getHeight()  : string|null
getId()  : int|null
getTranslation()  : TTranslation|null
getTranslations()  : Collection<int, TTranslation>
getWidth()  : string|null
isActivated()  : bool
isPersisted()  : bool
removeTranslation()  : $this
setActivated()  : $this
setAdvertRels()  : $this
setAttributeClass()  : $this
setAttributeId()  : $this
setHeight()  : $this
setId()  : $this
setTranslations()  : $this
setWidth()  : $this
translationCollectionInit()  : void
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$advertRels

protected Collection<int, AdvertPlaceRel> $advertRels
Attributes
#[CollectionOf]
\App\UI\Admin\Base\Models\Entities\AdvertPlaceRel::class
$owned: true
#[OneToMany]
$targetEntity: \App\UI\Admin\Base\Models\Entities\AdvertPlaceRel::class
$mappedBy: 'advertPlace'
$cascade: ["persist", "remove"]
$orphanRemoval: true
$fetch: "LAZY"
#[OrderBy]
['order' => 'ASC']

$attributeClass

protected string|null $attributeClass = null
Attributes
#[Column]
$name: 'attribute_class'
$type: 'string'
$length: 50
$nullable: true

$attributeId

protected string|null $attributeId = null
Attributes
#[Column]
$name: 'attribute_id'
$type: 'string'
$length: 50
$nullable: true

$height

protected string|null $height = null
Attributes
#[Column]
$name: 'height'
$type: 'string'
$length: 15
$nullable: true

$id

protected int|null $id = null
Attributes
#[Column]
$name: 'advert_place_id'
$type: 'integer'
$options: ['unsigned' => true]
#[GeneratedValue]
#[Id]

$translations

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

$width

protected string|null $width = null
Attributes
#[Column]
$name: 'width'
$type: 'string'
$length: 15
$nullable: true

Methods

__construct()

public __construct([int|null $id = null ][, string|null $attributeClass = null ][, string|null $attributeId = null ][, string|null $width = null ][, string|null $height = null ][, bool $activated = false ]) : mixed
Parameters
$id : int|null = null
$attributeClass : string|null = null
$attributeId : string|null = null
$width : string|null = null
$height : string|null = null
$activated : bool = false

addAdvertRel()

public addAdvertRel(TRel $rel) : $this
Parameters
$rel : TRel
Return values
$this

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

getActivated()

public getActivated() : bool
Return values
bool

getAdvertRels()

public getAdvertRels() : Collection<int, TRel>
Return values
Collection<int, TRel>

getAdverts()

Returns the linked adverts, extracted from `advertRels`.

public getAdverts() : Collection<int, TAdvert>
Return values
Collection<int, TAdvert>

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|null

getAttributeId()

public getAttributeId() : string|null
Return values
string|null

getHeight()

public getHeight() : string|null
Return values
string|null

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>

getWidth()

public getWidth() : string|null
Return values
string|null

isActivated()

public isActivated() : bool
Return values
bool

removeTranslation()

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

setActivated()

public setActivated(bool $activated) : $this
Parameters
$activated : bool
Return values
$this

setAdvertRels()

public setAdvertRels(Collection<int, TRel>|array<int, TRel> $advertRels) : $this
Parameters
$advertRels : Collection<int, TRel>|array<int, TRel>
Return values
$this

setAttributeClass()

public setAttributeClass(string|null $attributeClass) : $this
Parameters
$attributeClass : string|null
Return values
$this

setAttributeId()

public setAttributeId(string|null $attributeId) : $this
Parameters
$attributeId : string|null
Return values
$this

setHeight()

public setHeight(string|null $height) : $this
Parameters
$height : string|null
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

setWidth()

public setWidth(string|null $width) : $this
Parameters
$width : string|null
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