CoolCMS API

Event extends Event
in package

Admin variant of an event (`cms_mod_blog_events`), hydrated from the `api/blog/event` endpoint.

The admin presenter edits translations, scalar fields (dates, address, activation, author), the main image (asset) and the FKs to the user (user) and region (region). Categories, tags and galleries are not edited here, so they are not mapped.

The main photo is uploaded through the ImageUpload component (bytes go to the Api in $meta); saving the variants and the Asset entity is done by EventManager.

Tags
extends
Attributes
#[Entity]
#[Table]
$name: 'cms_mod_blog_events'
#[TableAlias]
'event'

Table of Contents

Properties

$active  : bool
$address  : string|null
$asset  : TImage|null
$author  : string|null
$categories  : Collection<int, TCategory>
$commentThreadId  : int|null
$fromDatetime  : DateTime|null
$galleries  : Collection<int, TGallery>
$id  : int|null
$insertDatetime  : DateTime
$publicationDatetime  : DateTime|null
$region  : TRegion|null
$regionId  : int|null
$tags  : Collection<int, TTag>
$toDatetime  : DateTime|null
$translations  : Collection<int, EventText>
$user  : TUser|null
$userId  : int|null

Methods

__construct()  : mixed
addCategory()  : $this
addGallery()  : $this
addTag()  : $this
addTranslation()  : $this
callInitMethods()  : void
Calls `init{TraitName}()` for every used trait that defines such a method.
categoryCollectionInit()  : void
clearCategories()  : $this
clearGalleries()  : $this
clearTags()  : $this
galleryCollectionInit()  : void
getActive()  : bool
getAddress()  : string|null
getAllTraits()  : array<string, string>
Returns all traits the class uses, including those used by parent classes and nested traits.
getAsset()  : TImage|null
getAuthor()  : string|null
getCategories()  : Collection<int, TCategory>
getCategoryIds()  : array<string|int, int>
getCommentThreadId()  : int|null
getFirstCategoryId()  : int|null
getFrom()  : DateTime|null
getFromDatetime()  : DateTime|null
getGalleries()  : Collection<int, TGallery>
getId()  : int|null
getInsertDatetime()  : DateTime
getPublicationDatetime()  : DateTime|null
getPublished()  : DateTime|null
getRegion()  : object|null
getRegionId()  : int|null
getTagIds()  : array<int, int|null>
getTags()  : Collection<int, TTag>
getTo()  : DateTime|null
getToDatetime()  : DateTime|null
getTranslation()  : TTranslation|null
getTranslations()  : Collection<int, TTranslation>
getUser()  : TUser|null
getUserId()  : int|null
isActive()  : bool
isPersisted()  : bool
isPubliclyVisible()  : bool
Whether the detail is public: active and published today or earlier (day granularity, same rule as the list).
removeCategory()  : $this
removeGallery()  : $this
removeTag()  : $this
removeTranslation()  : $this
setActive()  : $this
setAddress()  : $this
setAsset()  : $this
setAuthor()  : $this
setCategories()  : $this
setCommentThreadId()  : $this
setFrom()  : $this
setFromDatetime()  : $this
setGalleries()  : $this
setId()  : $this
setInsertDatetime()  : $this
setPublicationDatetime()  : $this
setPublished()  : $this
setRegion()  : $this
setRegionId()  : $this
setTags()  : $this
setTo()  : $this
setToDatetime()  : $this
setTranslations()  : $this
setUser()  : $this
setUserId()  : $this
tagCollectionInit()  : void
translationCollectionInit()  : void
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$active

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

$address

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

$asset

protected TImage|null $asset = null
Attributes
#[EntityOf]
\App\UI\Admin\System\Models\Entities\Asset::class
#[JoinColumn]
$name: 'cms_system_images_image_id'
$referencedColumnName: 'image_id'
$nullable: true
$onDelete: 'SET NULL'
#[ManyToOne]
$targetEntity: \App\UI\Admin\System\Models\Entities\Asset::class
$fetch: "LAZY"

$author

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

$categories

protected Collection<int, TCategory> $categories = new ArrayCollection()
Attributes
#[Transient]

$commentThreadId

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

$fromDatetime

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

$galleries

protected Collection<int, TGallery> $galleries = new ArrayCollection()
Attributes
#[Transient]

$id

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

$insertDatetime

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

$publicationDatetime

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

$region

protected TRegion|null $region = null
Attributes
#[EntityOf]
\App\UI\Admin\System\Models\Entities\Region::class
#[JoinColumn]
$name: 'cms_system_regions_region_id'
$referencedColumnName: 'region_id'
$nullable: true
$onDelete: 'SET NULL'
#[ManyToOne]
$targetEntity: \App\UI\Admin\System\Models\Entities\Region::class
$fetch: "LAZY"

$regionId

protected int|null $regionId = null
Attributes
#[Column]
$name: 'cms_system_regions_region_id'
$type: 'integer'
$nullable: true
$insertable: false
$updatable: false
$options: ['unsigned' => true]

$tags

protected Collection<int, TTag> $tags = new ArrayCollection()
Attributes
#[Transient]

$toDatetime

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

$translations

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

$user

protected TUser|null $user = null
Attributes
#[EntityOf]
\App\UI\Admin\System\Models\Entities\User::class
#[JoinColumn]
$name: 'cms_system_users_user_id'
$referencedColumnName: 'user_id'
$nullable: true
$onDelete: 'SET NULL'
#[ManyToOne]
$targetEntity: \App\UI\Admin\System\Models\Entities\User::class
$fetch: "LAZY"

$userId

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

Methods

__construct()

public __construct([int|null $id = null ][, int|null $commentThreadId = null ][, DateTime|null $fromDatetime = null ][, DateTime|null $toDatetime = null ][, DateTime|null $publicationDatetime = null ][, string|null $address = null ][, DateTime $insertDatetime = new DateTime() ][, bool $active = true ][, string|null $author = null ][, int|null $userId = null ][, int|null $regionId = null ][, mixed $user = null ][, mixed $region = null ][, mixed $asset = null ][, Collection $translations = new ArrayCollection() ][, Collection $categories = new ArrayCollection() ][, Collection $tags = new ArrayCollection() ][, Collection $galleries = new ArrayCollection() ]) : mixed
Parameters
$id : int|null = null
$commentThreadId : int|null = null
$fromDatetime : DateTime|null = null
$toDatetime : DateTime|null = null
$publicationDatetime : DateTime|null = null
$address : string|null = null
$insertDatetime : DateTime = new DateTime()
$active : bool = true
$author : string|null = null
$userId : int|null = null
$regionId : int|null = null
$user : mixed = null
$region : mixed = null
$asset : mixed = null
$translations : Collection = new ArrayCollection()
$categories : Collection = new ArrayCollection()
$tags : Collection = new ArrayCollection()
$galleries : Collection = new ArrayCollection()

addCategory()

public addCategory(TCategory $category) : $this
Parameters
$category : TCategory
Return values
$this

addGallery()

public addGallery(TGallery $gallery) : $this
Parameters
$gallery : TGallery
Return values
$this

addTag()

public addTag(TTag $tag) : $this
Parameters
$tag : TTag
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

getActive()

public getActive() : bool
Return values
bool

getAddress()

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

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>

getAsset()

public getAsset() : TImage|null
Return values
TImage|null

getAuthor()

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

getCategories()

public getCategories() : Collection<int, TCategory>
Return values
Collection<int, TCategory>

getCategoryIds()

public getCategoryIds() : array<string|int, int>
Return values
array<string|int, int>

getCommentThreadId()

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

getFrom()

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

getFromDatetime()

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

getGalleries()

public getGalleries() : Collection<int, TGallery>
Return values
Collection<int, TGallery>

getInsertDatetime()

public getInsertDatetime() : DateTime
Return values
DateTime

getPublicationDatetime()

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

getPublished()

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

getRegion()

public getRegion() : object|null
Return values
object|null —

region (loaded with the region include)

getRegionId()

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

getTagIds()

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

ids of the attached tags (getId() is ?int)

getTags()

public getTags() : Collection<int, TTag>
Return values
Collection<int, TTag>

getTo()

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

getToDatetime()

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

isActive()

public isActive() : bool
Return values
bool

isPubliclyVisible()

Whether the detail is public: active and published today or earlier (day granularity, same rule as the list).

public isPubliclyVisible([DateTimeInterface|null $now = null ]) : bool

A finished event (toDatetime in the past) stays visible; no publication date means no scheduling.

Parameters
$now : DateTimeInterface|null = null
Return values
bool

removeCategory()

public removeCategory(TCategory $category) : $this
Parameters
$category : TCategory
Return values
$this

removeGallery()

public removeGallery(TGallery $gallery) : $this
Parameters
$gallery : TGallery
Return values
$this

removeTag()

public removeTag(TTag $tag) : $this
Parameters
$tag : TTag
Return values
$this

removeTranslation()

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

setActive()

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

setAddress()

public setAddress(string|null $a) : $this
Parameters
$a : string|null
Return values
$this

setAsset()

public setAsset(TImage|null $asset) : $this
Parameters
$asset : TImage|null
Return values
$this

setAuthor()

public setAuthor(string|null $author) : $this
Parameters
$author : string|null
Return values
$this

setCategories()

public setCategories(Collection<int, TCategory>|array<int, TCategory> $categories) : $this
Parameters
$categories : Collection<int, TCategory>|array<int, TCategory>
Return values
$this

setCommentThreadId()

public setCommentThreadId(int|null $commentThreadId) : $this
Parameters
$commentThreadId : int|null
Return values
$this

setFrom()

public setFrom(DateTime|null $dt) : $this
Parameters
$dt : DateTime|null
Return values
$this

setFromDatetime()

public setFromDatetime(DateTime|null $dt) : $this
Parameters
$dt : DateTime|null
Return values
$this

setGalleries()

public setGalleries(Collection<int, TGallery>|array<int, TGallery> $galleries) : $this
Parameters
$galleries : Collection<int, TGallery>|array<int, TGallery>
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

setPublicationDatetime()

public setPublicationDatetime(DateTime|null $dt) : $this
Parameters
$dt : DateTime|null
Return values
$this

setPublished()

public setPublished(DateTime|null $published) : $this
Parameters
$published : DateTime|null
Return values
$this

setRegion()

public setRegion(TRegion|null $region) : $this
Parameters
$region : TRegion|null
Return values
$this

setRegionId()

public setRegionId(int|null $regionId) : $this
Parameters
$regionId : int|null
Return values
$this

setTags()

public setTags(Collection<int, TTag>|array<int, TTag> $tags) : $this
Parameters
$tags : Collection<int, TTag>|array<int, TTag>
Return values
$this

setTo()

public setTo(DateTime|null $dt) : $this
Parameters
$dt : DateTime|null
Return values
$this

setToDatetime()

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