CoolCMS API

PageSection extends PageSection
in package

Page section (`page_sections`): a named HTML block inserted into templates by key (`homepage-how`, `cta-providers` ...), replacing blocks hard-written in templates. No own URL, no tree, no order; it is addressed only by the key.

Tags
extends
Attributes
#[Entity]
#[Table]
$name: 'cms_system_page_sections'
#[TableAlias]
'pageSection'

Table of Contents

Properties

$active  : bool
$deleted  : bool
$id  : int|null
$insertDatetime  : DateTime
$key  : string
$note  : string|null
$translations  : Collection
$updateDatetime  : DateTime|null

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.
getDeleted()  : bool
getId()  : int|null
getInsertDatetime()  : DateTime
getKey()  : string
getNote()  : string|null
getTranslation()  : TTranslation|null
getTranslations()  : Collection<int, TTranslation>
getUpdateDatetime()  : DateTime|null
isActive()  : bool
isDeleted()  : bool
isPersisted()  : bool
removeTranslation()  : $this
setActive()  : $this
setDeleted()  : $this
setId()  : $this
setInsertDatetime()  : $this
setKey()  : $this
setNote()  : $this
setTranslations()  : $this
setUpdateDatetime()  : $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: 'page_section_id'
$type: 'integer'
$options: ['unsigned' => true]
#[GeneratedValue]
#[Id]

$insertDatetime

protected DateTime $insertDatetime = new DateTime()
Attributes
#[Column]
$name: 'insert_datetime'
$type: 'datetime'
#[ExternalReadonly]

$key

protected string $key = ''
Attributes
#[Column]
$name: '`key`'
$type: 'string'
$length: 80

$note

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

$translations

protected Collection $translations
Attributes
#[OneToMany]
$targetEntity: \App\UI\Api\System\Models\Entities\PageSectionText::class
$mappedBy: 'parent'
$cascade: ["persist", "remove"]
$orphanRemoval: true
$fetch: "LAZY"

$updateDatetime

protected DateTime|null $updateDatetime = null
Attributes
#[Column]
$name: 'update_datetime'
$type: 'datetime'
$nullable: true
#[ExternalReadonly]

Methods

__construct()

public __construct([int|null $id = null ][, string $key = '' ][, string|null $note = null ][, bool $active = true ][, bool $deleted = false ][, DateTime $insertDatetime = new DateTime() ][, DateTime|null $updateDatetime = null ]) : mixed
Parameters
$id : int|null = null
$key : string = ''
$note : string|null = null
$active : bool = true
$deleted : bool = false
$insertDatetime : DateTime = new DateTime()
$updateDatetime : DateTime|null = null

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

getActive()

public getActive() : bool
Return values
bool

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>

getDeleted()

public getDeleted() : bool
Return values
bool

getInsertDatetime()

public getInsertDatetime() : DateTime
Return values
DateTime

getKey()

public getKey() : string
Return values
string

getNote()

public getNote() : 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>

getUpdateDatetime()

public getUpdateDatetime() : DateTime|null
Return values
DateTime|null

isActive()

public isActive() : bool
Return values
bool

isDeleted()

public isDeleted() : bool
Return values
bool

removeTranslation()

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

setActive()

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

setDeleted()

public setDeleted(bool $deleted) : $this
Parameters
$deleted : bool
Return values
$this

setId()

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

setInsertDatetime()

public setInsertDatetime(DateTime $insertDatetime) : $this
Parameters
$insertDatetime : DateTime
Return values
$this

setKey()

public setKey(string $key) : $this
Parameters
$key : string
Return values
$this

setNote()

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

setUpdateDatetime()

public setUpdateDatetime(DateTime|null $updateDatetime) : $this
Parameters
$updateDatetime : DateTime|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