Intro
extends Intro
in package
Tags
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_mod_blog_intros'
- #[TableAlias]
- 'intro'
Table of Contents
Properties
- $activated : bool
- $assetRels : Collection
- $assets : array<int, array<int, TImage>>
- $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'
$assetRels
protected
Collection
$assetRels
Attributes
- #[CollectionOf]
- \App\UI\Front\Blog\Models\Entities\IntroAssetRel::class
- $owned: true
- #[OneToMany]
- $targetEntity: \App\UI\Front\Blog\Models\Entities\IntroAssetRel::class
- $mappedBy: 'intro'
- $cascade: ["persist", "remove"]
- $orphanRemoval: true
- $fetch: "LAZY"
$assets
protected
array<int, array<int, TImage>>
$assets
= []
Attributes
- #[Transient]
$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'
$published
protected
DateTime|null
$published
= null
Attributes
- #[Column]
- $name: 'published'
- $type: 'datetime'
- $nullable: true
$translations
protected
Collection
$translations
Attributes
- #[CollectionOf]
- \App\UI\Front\Blog\Models\Entities\IntroText::class
- $owned: true
- #[OneToMany]
- $targetEntity: \App\UI\Front\Blog\Models\Entities\IntroText::class
- $mappedBy: 'parent'
- $cascade: ["persist", "remove"]
- $orphanRemoval: true
- $fetch: "LAZY"
$user
protected
TUser|null
$user
= null
Attributes
- #[Transient]
$userId
protected
int|null
$userId
= null
Attributes
- #[Column]
- $name: 'cms_system_users_user_id'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
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
$thisaddTranslation()
public
addTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thisassetRelCollectionInit()
public
assetRelCollectionInit() : void
callInitMethods()
Calls `init{TraitName}()` for every used trait that defines such a method.
public
callInitMethods() : void
getActivated()
public
getActivated() : bool
Return values
boolgetAllTraits()
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)
getId()
public
getId() : int|null
Return values
int|nullgetInsertDatetime()
public
getInsertDatetime() : DateTime
Return values
DateTimegetMainAsset()
public
getMainAsset() : Asset|null
Return values
Asset|null —main image (else the first non-removed one)
getPublished()
public
getPublished() : DateTime|null
Return values
DateTime|nullgetTranslation()
public
getTranslation(int $langId) : TTranslation|null
Parameters
- $langId : int
Return values
TTranslation|nullgetTranslations()
public
getTranslations() : Collection<int, TTranslation>
Return values
Collection<int, TTranslation>getUser()
public
getUser() : TUser|null
Return values
TUser|nullgetUserId()
public
getUserId() : int|null
Return values
int|nullisActivated()
public
isActivated() : bool
Return values
boolisPersisted()
public
isPersisted() : bool
Return values
boolremoveAssetRel()
public
removeAssetRel(TAssetRel $assetRel) : $this
Parameters
- $assetRel : TAssetRel
Return values
$thisremoveTranslation()
public
removeTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thissetActivated()
public
setActivated(bool $activated) : $this
Parameters
- $activated : bool
Return values
$thissetAssetRels()
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
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetInsertDatetime()
public
setInsertDatetime(DateTime $dt) : $this
Parameters
- $dt : DateTime
Return values
$thissetPublished()
public
setPublished(DateTime|null $published) : $this
Parameters
- $published : DateTime|null
Return values
$thissetTranslations()
public
setTranslations(Collection<int, TTranslation>|array<int, TTranslation> $translations) : $this
Parameters
- $translations : Collection<int, TTranslation>|array<int, TTranslation>
Return values
$thissetUser()
public
setUser(TUser|null $user) : $this
Parameters
- $user : TUser|null
Return values
$thissetUserId()
public
setUserId(int|null $userId) : $this
Parameters
- $userId : int|null
Return values
$thistranslationCollectionInit()
public
translationCollectionInit() : void
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>