CoolCMS API

Intro extends Intro
in package

Tags
extends
Attributes
#[Entity]
#[Table]
$name: 'cms_mod_blog_intros'
#[TableAlias]
'intro'

Table of Contents

Properties

$activated  : bool
$assetRels  : Collection
$assets  : array<string|int, mixed>
$id  : int|null
$insertDatetime  : DateTime
$published  : DateTime|null
$translations  : Collection
$user  : TUser|null
$userId  : int|null

Methods

__construct()  : mixed
addAssetRel()  : $this
addTranslation()  : $this
assetRelCollectionInit()  : void
callInitMethods()  : void
Calls `init{TraitName}()` for every used trait that defines such a method.
getActivated()  : bool
getAllTraits()  : array<string, string>
Returns all traits the class uses, including those used by parent classes and nested traits.
getAssetRels()  : Collection<int, TAssetRel>
getAssets()  : array<int, array<int, Asset|null>>
getId()  : int|null
getInsertDatetime()  : DateTime
getMainAsset()  : Asset|null
getPublished()  : DateTime|null
getTranslation()  : TTranslation|null
getTranslations()  : Collection<int, TTranslation>
getUser()  : TUser|null
getUserId()  : int|null
isActivated()  : bool
isPersisted()  : bool
removeAssetRel()  : $this
removeTranslation()  : $this
setActivated()  : $this
setAssetRels()  : $this
IMPORTANT: the parameter type must be `Collection`, not `ArrayCollection`; the keep branch of the Api `SaveTrait` can pass a `PersistentCollection` from a managed entity, and a narrower type would throw a `TypeError` and fail the save.
setId()  : $this
setInsertDatetime()  : $this
setPublished()  : $this
setTranslations()  : $this
setUser()  : $this
setUserId()  : $this
translationCollectionInit()  : void
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$activated

protected bool $activated = true
Attributes
#[Column]
$name: 'activated'
$type: 'boolean'
#[ExternalReadonly]

$assetRels

protected Collection $assetRels
Attributes
#[OneToMany]
$targetEntity: \App\UI\Api\Blog\Models\Entities\IntroAssetRel::class
$mappedBy: 'intro'
$cascade: ["persist", "remove"]
$orphanRemoval: true
$fetch: "LAZY"

$assets

protected array<string|int, mixed> $assets = []

$id

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

$insertDatetime

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

$published

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

$translations

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

$userId

protected int|null $userId = null
Attributes
#[Column]
$name: 'cms_system_users_user_id'
$type: 'integer'
$nullable: true
$options: ['unsigned' => true]
#[ExternalReadonly]

Methods

__construct()

public __construct([int|null $id = null ][, int|null $userId = null ][, bool $activated = true ][, DateTime|null $published = null ][, DateTime $insertDatetime = new DateTime() ][, mixed $user = null ][, Collection $translations = new ArrayCollection() ][, Collection $assetRels = new ArrayCollection() ]) : mixed
Parameters
$id : int|null = null
$userId : int|null = null
$activated : bool = true
$published : DateTime|null = null
$insertDatetime : DateTime = new DateTime()
$user : mixed = null
$translations : Collection = new ArrayCollection()
$assetRels : Collection = new ArrayCollection()

addAssetRel()

public addAssetRel(TAssetRel $assetRel) : $this
Parameters
$assetRel : TAssetRel
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

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>

getAssetRels()

public getAssetRels() : Collection<int, TAssetRel>
Return values
Collection<int, TAssetRel>

getAssets()

public getAssets() : array<int, array<int, Asset|null>>
Return values
array<int, array<int, Asset|null>> —

images grouped by language (key = languageId)

getInsertDatetime()

public getInsertDatetime() : DateTime
Return values
DateTime

getPublished()

public getPublished() : DateTime|null
Return values
DateTime|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>

getUser()

public getUser() : TUser|null
Return values
TUser|null

getUserId()

public getUserId() : int|null
Return values
int|null

isActivated()

public isActivated() : bool
Return values
bool

removeAssetRel()

public removeAssetRel(TAssetRel $assetRel) : $this
Parameters
$assetRel : TAssetRel
Return values
$this

removeTranslation()

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

setActivated()

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

setAssetRels()

IMPORTANT: the parameter type must be `Collection`, not `ArrayCollection`; the keep branch of the Api `SaveTrait` can pass a `PersistentCollection` from a managed entity, and a narrower type would throw a `TypeError` and fail the save.

public setAssetRels(Collection<int, TAssetRel> $assetRels) : $this
Parameters
$assetRels : Collection<int, TAssetRel>
Return values
$this

setId()

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

setInsertDatetime()

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

setPublished()

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

setUser()

public setUser(TUser|null $user) : $this
Parameters
$user : TUser|null
Return values
$this

setUserId()

public setUserId(int|null $userId) : $this
Parameters
$userId : int|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