Article
extends Article
in package
Tags
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_mod_blog_articles'
- #[TableAlias]
- 'article'
Table of Contents
Properties
- $activated : bool
- $advertRels : Collection<int, TAdvertRel>
- $asset : TImage|null
- $author : string|null
- $categories : Collection<int, Category>
- $commentThread : CommentThread|null
- $galleries : Collection<int, Gallery>
- $iconClass : string|null
- $id : int|null
- $insertTime : DateTime
- $main : bool
- Main article of the editorial front page ({@see \App\UI\Front\Blog\Components\MainArticleListComponent\MainArticleList}).
- $pollRels : Collection<int, TPollRel>
- $published : DateTime|null
- $purchaseUrl : string|null
- $ratingThread : RatingThread|null
- $region : object|null
- $regionId : int|null
- $tags : Collection<int, Tag>
- $translations : Collection
- $updateDatetime : DateTime|null
- $user : TUser|null
- $userId : int|null
- $views : int
Methods
- __construct() : mixed
- addAdvertRel() : $this
- addCategory() : $this
- addGallery() : $this
- addPollRel() : $this
- addTag() : $this
- addTranslation() : $this
- advertRelCollectionInit() : void
- callInitMethods() : void
- Calls `init{TraitName}()` for every used trait that defines such a method.
- categoryCollectionInit() : void
- clearAdvertRels() : $this
- clearCategories() : $this
- clearGalleries() : $this
- clearPollRels() : $this
- clearTags() : $this
- galleryCollectionInit() : void
- getActivated() : bool
- getAdvertRels() : Collection<int, TRel>
- 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>
- getCommentThread() : object|null
- getCommentThreadId() : int|null
- getFirstCategoryId() : int|null
- getGalleries() : Collection<int, TGallery>
- getIconClass() : string|null
- getId() : int|null
- getInsertTime() : DateTime
- getMain() : bool
- getPollRels() : Collection<int, TRel>
- getPublished() : DateTime|null
- getPurchaseUrl() : string|null
- getRatingThread() : object|null
- getRatingThreadId() : int|null
- getRegion() : object|null
- getRegionId() : int|null
- getTagIds() : array<int, int|null>
- getTags() : Collection<int, TTag>
- getTranslation() : TTranslation|null
- getTranslations() : Collection<int, TTranslation>
- getUpdateDatetime() : DateTime|null
- getUser() : TUser|null
- getUserId() : int|null
- getViews() : int
- isActivated() : bool
- isMain() : bool
- isOpenAccess() : bool
- Whether anyone may read the whole article: it lies in at least one active free category.
- isPersisted() : bool
- isPubliclyVisible() : bool
- pollRelCollectionInit() : void
- removeCategory() : $this
- removeGallery() : $this
- removeTag() : $this
- removeTranslation() : $this
- setActivated() : $this
- setAdvertRels() : $this
- setAsset() : $this
- setAuthor() : $this
- setCategories() : $this
- setCommentThread() : $this
- setGalleries() : $this
- setIconClass() : $this
- setId() : $this
- setInsertTime() : $this
- setMain() : static
- setPollRels() : $this
- setPublished() : $this
- setPurchaseUrl() : $this
- setRatingThread() : $this
- setRegion() : $this
- setRegionId() : $this
- setTags() : $this
- setTranslations() : $this
- setUpdateDatetime() : $this
- setUser() : $this
- setUserId() : $this
- setViews() : $this
- tagCollectionInit() : void
- 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'
$advertRels
protected
Collection<int, TAdvertRel>
$advertRels
= new ArrayCollection()
Attributes
- #[Transient]
$asset
protected
TImage|null
$asset
= null
Attributes
- #[EntityOf]
- \App\UI\Front\System\Models\Entities\Asset::class
- #[JoinColumn]
- $name: 'cms_system_images_image_id'
- $referencedColumnName: 'image_id'
- $nullable: true
- $onDelete: 'SET NULL'
- #[ManyToOne]
- $targetEntity: \App\UI\Front\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, Category>
$categories
Attributes
- #[CollectionOf]
- \App\UI\Front\Blog\Models\Entities\Category::class
- #[JoinTable]
- $name: 'cms_mod_blog_article_category_relations'
- $joinColumns: [new \Doctrine\ORM\Mapping\JoinColumn(name: 'cms_mod_blog_articles_article_id', referencedColumnName: 'article_id', onDelete: 'CASCADE')]
- $inverseJoinColumns: [new \Doctrine\ORM\Mapping\JoinColumn(name: 'cms_mod_blog_categories_category_id', referencedColumnName: 'category_id', onDelete: 'CASCADE')]
- #[ManyToMany]
- $targetEntity: \App\UI\Front\Blog\Models\Entities\Category::class
- $fetch: "LAZY"
$commentThread
protected
CommentThread|null
$commentThread
= null
Attributes
- #[EntityOf]
- \App\UI\Front\Base\Models\Entities\CommentThread::class
- #[JoinColumn]
- $name: 'cms_mod_base_comment_threads_comment_thread_id'
- $referencedColumnName: 'comment_thread_id'
- $nullable: true
- $onDelete: 'SET NULL'
- #[ManyToOne]
- $targetEntity: \App\UI\Front\Base\Models\Entities\CommentThread::class
- $fetch: "LAZY"
$galleries
protected
Collection<int, Gallery>
$galleries
Attributes
- #[CollectionOf]
- \App\UI\Front\Blog\Models\Entities\Gallery::class
- #[JoinTable]
- $name: 'cms_mod_blog_article_gallery_relations'
- $joinColumns: [new \Doctrine\ORM\Mapping\JoinColumn(name: 'cms_mod_blog_articles_article_id', referencedColumnName: 'article_id', onDelete: 'CASCADE')]
- $inverseJoinColumns: [new \Doctrine\ORM\Mapping\JoinColumn(name: 'cms_mod_blog_galleries_gallery_id', referencedColumnName: 'gallery_id', onDelete: 'CASCADE')]
- #[ManyToMany]
- $targetEntity: \App\UI\Front\Blog\Models\Entities\Gallery::class
- $fetch: "LAZY"
$iconClass
protected
string|null
$iconClass
= null
Attributes
- #[Column]
- $name: 'icon_class'
- $type: 'string'
- $length: 50
- $nullable: true
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'article_id'
- $type: 'integer'
- #[GeneratedValue]
- #[Id]
$insertTime
protected
DateTime
$insertTime
= new DateTime()
Attributes
- #[Column]
- $name: 'insert_time'
- $type: 'datetime'
$main
Main article of the editorial front page ({@see \App\UI\Front\Blog\Components\MainArticleListComponent\MainArticleList}).
protected
bool
$main
= false
Not unique: several articles may be marked and the newest published one is shown, so saving an article never touches other articles. Editorial curation: admin and cron write it freely, an external client cannot promote itself to the front page.
Attributes
- #[Column]
- $name: 'main'
- $type: 'boolean'
- $options: ['default' => 0]
$pollRels
protected
Collection<int, TPollRel>
$pollRels
= new ArrayCollection()
Attributes
- #[Transient]
$published
protected
DateTime|null
$published
= null
Attributes
- #[Column]
- $name: 'published'
- $type: 'datetime'
- $nullable: true
$purchaseUrl
protected
string|null
$purchaseUrl
= null
Attributes
- #[Column]
- $name: 'purchase_url'
- $type: 'string'
- $length: 255
- $nullable: true
$ratingThread
protected
RatingThread|null
$ratingThread
= null
Attributes
- #[EntityOf]
- \App\UI\Front\Base\Models\Entities\RatingThread::class
- #[JoinColumn]
- $name: 'cms_mod_base_rating_threads_rating_thread_id'
- $referencedColumnName: 'rating_thread_id'
- $nullable: true
- $onDelete: 'SET NULL'
- #[ManyToOne]
- $targetEntity: \App\UI\Front\Base\Models\Entities\RatingThread::class
- $fetch: "LAZY"
$region
protected
object|null
$region
= null
Attributes
- #[EntityOf]
- \App\UI\Front\System\Models\Entities\Region::class
- #[JoinColumn]
- $name: 'cms_system_regions_region_id'
- $referencedColumnName: 'region_id'
- $nullable: true
- $onDelete: 'SET NULL'
- #[ManyToOne]
- $targetEntity: \App\UI\Front\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, Tag>
$tags
Attributes
- #[CollectionOf]
- \App\UI\Front\Blog\Models\Entities\Tag::class
- #[JoinTable]
- $name: 'cms_mod_blog_article_tag_relations'
- $joinColumns: [new \Doctrine\ORM\Mapping\JoinColumn(name: 'cms_mod_blog_articles_article_id', referencedColumnName: 'article_id', onDelete: 'CASCADE')]
- $inverseJoinColumns: [new \Doctrine\ORM\Mapping\JoinColumn(name: 'cms_mod_blog_tags_tag_id', referencedColumnName: 'tag_id', onDelete: 'CASCADE')]
- #[ManyToMany]
- $targetEntity: \App\UI\Front\Blog\Models\Entities\Tag::class
- $fetch: "LAZY"
$translations
protected
Collection
$translations
Attributes
- #[CollectionOf]
- \App\UI\Front\Blog\Models\Entities\ArticleText::class
- $owned: true
- #[OneToMany]
- $targetEntity: \App\UI\Front\Blog\Models\Entities\ArticleText::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
$user
protected
TUser|null
$user
= null
Attributes
- #[EntityOf]
- \App\UI\Front\System\Models\Entities\User::class
- #[JoinColumn]
- $name: 'cms_system_users_user_id'
- $referencedColumnName: 'user_id'
- $nullable: true
- $onDelete: 'SET NULL'
- #[ManyToOne]
- $targetEntity: \App\UI\Front\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
- $options: ['unsigned' => true]
$views
protected
int
$views
= 0
Attributes
- #[Column]
- $name: 'views'
- $type: 'integer'
- $options: ['default' => 0]
Methods
__construct()
public
__construct([int|null $id = null ][, DateTime $insertTime = new DateTime() ][, DateTime|null $updateDatetime = null ][, DateTime|null $published = null ][, bool $activated = false ][, bool $main = false ][, int|null $userId = null ][, int|null $regionId = null ][, mixed $user = null ][, mixed $region = null ][, mixed $asset = null ][, int $views = 0 ][, string|null $author = null ][, string|null $purchaseUrl = null ][, string|null $iconClass = null ][, Collection $translations = new ArrayCollection() ][, Collection $categories = new ArrayCollection() ][, Collection $tags = new ArrayCollection() ][, Collection $galleries = new ArrayCollection() ][, Collection $advertRels = new ArrayCollection() ][, Collection $pollRels = new ArrayCollection() ]) : mixed
Parameters
- $id : int|null = null
- $insertTime : DateTime = new DateTime()
- $updateDatetime : DateTime|null = null
- $published : DateTime|null = null
- $activated : bool = false
- $main : bool = false
- $userId : int|null = null
- $regionId : int|null = null
- $user : mixed = null
- $region : mixed = null
- $asset : mixed = null
- $views : int = 0
- $author : string|null = null
- $purchaseUrl : string|null = null
- $iconClass : string|null = null
- $translations : Collection = new ArrayCollection()
- $categories : Collection = new ArrayCollection()
- $tags : Collection = new ArrayCollection()
- $galleries : Collection = new ArrayCollection()
- $advertRels : Collection = new ArrayCollection()
- $pollRels : Collection = new ArrayCollection()
addAdvertRel()
public
addAdvertRel(TRel $rel) : $this
Parameters
- $rel : TRel
Return values
$thisaddCategory()
public
addCategory(TCategory $category) : $this
Parameters
- $category : TCategory
Return values
$thisaddGallery()
public
addGallery(TGallery $gallery) : $this
Parameters
- $gallery : TGallery
Return values
$thisaddPollRel()
public
addPollRel(TRel $rel) : $this
Parameters
- $rel : TRel
Return values
$thisaddTag()
public
addTag(TTag $tag) : $this
Parameters
- $tag : TTag
Return values
$thisaddTranslation()
public
addTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thisadvertRelCollectionInit()
public
advertRelCollectionInit() : void
callInitMethods()
Calls `init{TraitName}()` for every used trait that defines such a method.
public
callInitMethods() : void
categoryCollectionInit()
public
categoryCollectionInit() : void
clearAdvertRels()
public
clearAdvertRels() : $this
Return values
$thisclearCategories()
public
clearCategories() : $this
Return values
$thisclearGalleries()
public
clearGalleries() : $this
Return values
$thisclearPollRels()
public
clearPollRels() : $this
Return values
$thisclearTags()
public
clearTags() : $this
Return values
$thisgalleryCollectionInit()
public
galleryCollectionInit() : void
getActivated()
public
getActivated() : bool
Return values
boolgetAdvertRels()
public
getAdvertRels() : Collection<int, TRel>
Return values
Collection<int, TRel>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|nullgetAuthor()
public
getAuthor() : string|null
Return values
string|nullgetCategories()
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() : object|null
Return values
object|nullgetCommentThreadId()
public
getCommentThreadId() : int|null
Return values
int|nullgetFirstCategoryId()
public
getFirstCategoryId() : int|null
Return values
int|nullgetGalleries()
public
getGalleries() : Collection<int, TGallery>
Return values
Collection<int, TGallery>getIconClass()
public
getIconClass() : string|null
Return values
string|nullgetId()
public
getId() : int|null
Return values
int|nullgetInsertTime()
public
getInsertTime() : DateTime
Return values
DateTimegetMain()
public
getMain() : bool
Return values
boolgetPollRels()
public
getPollRels() : Collection<int, TRel>
Return values
Collection<int, TRel>getPublished()
public
getPublished() : DateTime|null
Return values
DateTime|nullgetPurchaseUrl()
public
getPurchaseUrl() : string|null
Return values
string|nullgetRatingThread()
public
getRatingThread() : object|null
Return values
object|nullgetRatingThreadId()
public
getRatingThreadId() : int|null
Return values
int|nullgetRegion()
public
getRegion() : object|null
Return values
object|nullgetRegionId()
public
getRegionId() : int|null
Return values
int|nullgetTagIds()
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>getTranslation()
public
getTranslation(int $langId) : TTranslation|null
Parameters
- $langId : int
Return values
TTranslation|nullgetTranslations()
public
getTranslations() : Collection<int, TTranslation>
Return values
Collection<int, TTranslation>getUpdateDatetime()
public
getUpdateDatetime() : DateTime|null
Return values
DateTime|nullgetUser()
public
getUser() : TUser|null
Return values
TUser|nullgetUserId()
public
getUserId() : int|null
Return values
int|nullgetViews()
public
getViews() : int
Return values
intisActivated()
public
isActivated() : bool
Return values
boolisMain()
public
isMain() : bool
Return values
boolisOpenAccess()
Whether anyone may read the whole article: it lies in at least one active free category.
public
isOpenAccess() : bool
Otherwise it is for members only (list card with a badge, detail = preview with a banner).
The categories must be loaded (include('categories…')), otherwise the article counts as paid.
Return values
boolisPersisted()
public
isPersisted() : bool
Return values
boolisPubliclyVisible()
public
isPubliclyVisible([DateTimeInterface|null $now = null ]) : bool
Parameters
- $now : DateTimeInterface|null = null
Return values
boolpollRelCollectionInit()
public
pollRelCollectionInit() : void
removeCategory()
public
removeCategory(TCategory $category) : $this
Parameters
- $category : TCategory
Return values
$thisremoveGallery()
public
removeGallery(TGallery $gallery) : $this
Parameters
- $gallery : TGallery
Return values
$thisremoveTag()
public
removeTag(TTag $tag) : $this
Parameters
- $tag : TTag
Return values
$thisremoveTranslation()
public
removeTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thissetActivated()
public
setActivated(bool $activated) : $this
Parameters
- $activated : bool
Return values
$thissetAdvertRels()
public
setAdvertRels(Collection<int, TRel>|array<int, TRel> $advertRels) : $this
Parameters
- $advertRels : Collection<int, TRel>|array<int, TRel>
Return values
$thissetAsset()
public
setAsset(TImage|null $asset) : $this
Parameters
- $asset : TImage|null
Return values
$thissetAuthor()
public
setAuthor(string|null $author) : $this
Parameters
- $author : string|null
Return values
$thissetCategories()
public
setCategories(Collection<int, TCategory>|array<int, TCategory> $categories) : $this
Parameters
- $categories : Collection<int, TCategory>|array<int, TCategory>
Return values
$thissetCommentThread()
public
setCommentThread(object|null $commentThread) : $this
Parameters
- $commentThread : object|null
Return values
$thissetGalleries()
public
setGalleries(Collection<int, TGallery>|array<int, TGallery> $galleries) : $this
Parameters
- $galleries : Collection<int, TGallery>|array<int, TGallery>
Return values
$thissetIconClass()
public
setIconClass(string|null $iconClass) : $this
Parameters
- $iconClass : string|null
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetInsertTime()
public
setInsertTime(DateTime $dt) : $this
Parameters
- $dt : DateTime
Return values
$thissetMain()
public
setMain(bool $main) : static
Parameters
- $main : bool
Return values
staticsetPollRels()
public
setPollRels(Collection<int, TRel>|array<int, TRel> $pollRels) : $this
Parameters
- $pollRels : Collection<int, TRel>|array<int, TRel>
Return values
$thissetPublished()
public
setPublished(DateTime|null $published) : $this
Parameters
- $published : DateTime|null
Return values
$thissetPurchaseUrl()
public
setPurchaseUrl(string|null $purchaseUrl) : $this
Parameters
- $purchaseUrl : string|null
Return values
$thissetRatingThread()
public
setRatingThread(object|null $ratingThread) : $this
Parameters
- $ratingThread : object|null
Return values
$thissetRegion()
public
setRegion(object|null $region) : $this
Parameters
- $region : object|null
Return values
$thissetRegionId()
public
setRegionId(int|null $regionId) : $this
Parameters
- $regionId : int|null
Return values
$thissetTags()
public
setTags(Collection<int, TTag>|array<int, TTag> $tags) : $this
Parameters
- $tags : Collection<int, TTag>|array<int, TTag>
Return values
$thissetTranslations()
public
setTranslations(Collection<int, TTranslation>|array<int, TTranslation> $translations) : $this
Parameters
- $translations : Collection<int, TTranslation>|array<int, TTranslation>
Return values
$thissetUpdateDatetime()
public
setUpdateDatetime(DateTime|null $dt) : $this
Parameters
- $dt : DateTime|null
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
$thissetViews()
public
setViews(int $views) : $this
Parameters
- $views : int
Return values
$thistagCollectionInit()
public
tagCollectionInit() : void
translationCollectionInit()
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>