CoolCMS API

Gallery extends Gallery
in package

Tags
extends
Attributes
#[Entity]
#[Table]
$name: 'cms_mod_blog_galleries'
#[TableAlias]
'gallery'

Table of Contents

Properties

$activated  : bool
$assetRels  : Collection<int, GalleryAssetRel>
$categories  : Collection
$commentThread  : CommentThread|null
Comment thread: an object ManyToOne association (FK `cms_mod_base_{comment,rating}_threads_*_thread_id`) mapped by the concrete UI variant.
$id  : int|null
$insertDatetime  : DateTime
$onlyForLogged  : bool
$published  : DateTime|null
$ratingThread  : RatingThread|null
$translations  : Collection
$userId  : int|null

Methods

__construct()  : mixed
addAssetRel()  : $this
addCategory()  : $this
addTranslation()  : $this
assetRelCollectionInit()  : void
callInitMethods()  : void
Calls `init{TraitName}()` for every used trait that defines such a method.
categoryCollectionInit()  : void
clearCategories()  : $this
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, mixed>
Assets of the non-removed rels, ordered by `order` — whatever the rel's untyped `getAsset()` holds (asset entity, or null).
getCategories()  : Collection<int, TCategory>
getCategoryIds()  : array<string|int, int>
getCommentThread()  : TCommentThread|null
getCommentThreadId()  : int|null
getFirstCategoryId()  : int|null
getId()  : int|null
getInsertDatetime()  : DateTime
getMainAsset()  : Asset|null
getOnlyForLogged()  : bool
getPublished()  : DateTime|null
getRatingThread()  : TRatingThread|null
getRatingThreadId()  : int|null
getTranslation()  : TTranslation|null
getTranslations()  : Collection<int, TTranslation>
getUserId()  : int|null
isActivated()  : bool
isOnlyForLogged()  : bool
isPersisted()  : bool
isVisibleFor()  : bool
Whether a visitor may see the gallery where it is attached (article and event detail): active, already published and, with `onlyForLogged`, only for a logged-in visitor. The detail used to print every attached gallery, including disabled, scheduled and logged-in-only ones.
removeAssetRel()  : $this
removeCategory()  : $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.
setCategories()  : $this
setCommentThread()  : $this
setId()  : $this
setInsertDatetime()  : $this
setOnlyForLogged()  : $this
setPublished()  : $this
setRatingThread()  : $this
setTranslations()  : $this
setUserId()  : $this
translationCollectionInit()  : void
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$activated

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

$assetRels

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

$categories

protected Collection $categories
Attributes
#[CollectionOf]
\App\UI\Admin\Blog\Models\Entities\Category::class
#[JoinTable]
$name: 'cms_mod_blog_gallery_category_relations'
$joinColumns: [new \Doctrine\ORM\Mapping\JoinColumn(name: 'cms_mod_blog_galleries_gallery_id', referencedColumnName: 'gallery_id')]
$inverseJoinColumns: [new \Doctrine\ORM\Mapping\JoinColumn(name: 'cms_mod_blog_categories_category_id', referencedColumnName: 'category_id')]
#[ManyToMany]
$targetEntity: \App\UI\Admin\Blog\Models\Entities\Category::class
$fetch: "LAZY"

$commentThread

Comment thread: an object ManyToOne association (FK `cms_mod_base_{comment,rating}_threads_*_thread_id`) mapped by the concrete UI variant.

protected CommentThread|null $commentThread = null
Attributes
#[EntityOf]
\App\UI\Admin\Base\Models\Entities\CommentThread::class
#[Transient]

$id

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

$insertDatetime

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

$onlyForLogged

protected bool $onlyForLogged = false
Attributes
#[Column]
$name: 'only_for_logged'
$type: 'boolean'

$published

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

$translations

protected Collection $translations
Attributes
#[CollectionOf]
\App\UI\Admin\Blog\Models\Entities\GalleryText::class
$owned: true
#[OneToMany]
$targetEntity: \App\UI\Admin\Blog\Models\Entities\GalleryText::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 $onlyForLogged = false ][, DateTime $insertDatetime = new DateTime() ][, DateTime|null $published = null ][, bool $activated = false ][, Collection $translations = new ArrayCollection() ][, Collection $assetRels = new ArrayCollection() ][, Collection $categories = new ArrayCollection() ]) : mixed
Parameters
$id : int|null = null
$userId : int|null = null
$onlyForLogged : bool = false
$insertDatetime : DateTime = new DateTime()
$published : DateTime|null = null
$activated : bool = false
$translations : Collection = new ArrayCollection()
$assetRels : Collection = new ArrayCollection()
$categories : Collection = new ArrayCollection()

addAssetRel()

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

addCategory()

public addCategory(TCategory $category) : $this
Parameters
$category : TCategory
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()

Assets of the non-removed rels, ordered by `order` — whatever the rel's untyped `getAsset()` holds (asset entity, or null).

public getAssets() : array<int, mixed>
Return values
array<int, mixed>

getCategories()

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

getCategoryIds()

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

getCommentThread()

public getCommentThread() : TCommentThread|null
Return values
TCommentThread|null

getCommentThreadId()

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

getInsertDatetime()

public getInsertDatetime() : DateTime
Return values
DateTime

getOnlyForLogged()

public getOnlyForLogged() : bool
Return values
bool

getPublished()

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

getRatingThread()

public getRatingThread() : TRatingThread|null
Return values
TRatingThread|null

getRatingThreadId()

public getRatingThreadId() : int|null
Return values
int|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>

getUserId()

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

isActivated()

public isActivated() : bool
Return values
bool

isOnlyForLogged()

public isOnlyForLogged() : bool
Return values
bool

isVisibleFor()

Whether a visitor may see the gallery where it is attached (article and event detail): active, already published and, with `onlyForLogged`, only for a logged-in visitor. The detail used to print every attached gallery, including disabled, scheduled and logged-in-only ones.

public isVisibleFor(bool $loggedIn[, DateTimeInterface|null $now = null ]) : bool
Parameters
$loggedIn : bool
$now : DateTimeInterface|null = null
Return values
bool

removeAssetRel()

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

removeCategory()

public removeCategory(TCategory $category) : $this
Parameters
$category : TCategory
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

setCategories()

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

setCommentThread()

public setCommentThread(TCommentThread|null $commentThread) : $this
Parameters
$commentThread : TCommentThread|null
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

setOnlyForLogged()

public setOnlyForLogged(bool $onlyForLogged) : $this
Parameters
$onlyForLogged : bool
Return values
$this

setPublished()

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

setRatingThread()

public setRatingThread(TRatingThread|null $ratingThread) : $this
Parameters
$ratingThread : TRatingThread|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

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