News
extends News
in package
Tags
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_mod_blog_news'
- #[TableAlias]
- 'news'
Table of Contents
Properties
- $active : bool
- $asset : TImage|null
- $author : string|null
- $categories : Collection<int, Category>
- $id : int|null
- $insertTime : DateTime
- $published : DateTime|null
- $region : object|null
- $regionId : int|null
- $translations : Collection
- $user : TUser|null
- $userId : int|null
Methods
- __construct() : mixed
- addCategory() : $this
- addTranslation() : $this
- callInitMethods() : void
- Calls `init{TraitName}()` for every used trait that defines such a method.
- categoryCollectionInit() : void
- clearCategories() : $this
- getActive() : bool
- 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>
- getFirstCategoryId() : int|null
- getId() : int|null
- getInsertTime() : DateTime
- getPublished() : DateTime|null
- getRegion() : object|null
- getRegionId() : int|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
- removeTranslation() : $this
- setActive() : $this
- setAsset() : $this
- setAuthor() : $this
- setCategories() : $this
- setId() : $this
- setInsertTime() : $this
- setPublished() : $this
- setRegion() : $this
- setRegionId() : $this
- setTranslations() : $this
- setUser() : $this
- setUserId() : $this
- translationCollectionInit() : void
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$active
protected
bool
$active
= true
Attributes
- #[Column]
- $name: 'activated'
- $type: 'boolean'
$asset
protected
TImage|null
$asset
= null
Attributes
- #[JoinColumn]
- $name: 'cms_system_images_image_id'
- $referencedColumnName: 'image_id'
- $nullable: true
- $onDelete: 'SET NULL'
- #[ManyToOne]
- $targetEntity: \App\UI\Api\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
- #[JoinTable]
- $name: 'cms_mod_blog_news_category_relations'
- $joinColumns: [new \Doctrine\ORM\Mapping\JoinColumn(name: 'cms_mod_blog_news_news_id', referencedColumnName: 'news_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\Api\Blog\Models\Entities\Category::class
- $fetch: "LAZY"
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'news_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$insertTime
protected
DateTime
$insertTime
= new DateTime()
Attributes
- #[Column]
- $name: 'insert_time'
- $type: 'datetime'
$published
protected
DateTime|null
$published
= null
Attributes
- #[Column]
- $name: 'published'
- $type: 'datetime'
- $nullable: true
$region
protected
object|null
$region
= null
Attributes
- #[JoinColumn]
- $name: 'cms_system_regions_region_id'
- $referencedColumnName: 'region_id'
- $nullable: true
- $onDelete: 'SET NULL'
- #[ManyToOne]
- $targetEntity: \App\UI\Api\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]
$translations
protected
Collection
$translations
Attributes
- #[OneToMany]
- $targetEntity: \App\UI\Api\Blog\Models\Entities\NewsText::class
- $mappedBy: 'parent'
- $cascade: ["persist", "remove"]
- $orphanRemoval: true
- $fetch: "LAZY"
$user
protected
TUser|null
$user
= null
Attributes
- #[JoinColumn]
- $name: 'cms_system_users_user_id'
- $referencedColumnName: 'user_id'
- $nullable: true
- $onDelete: 'SET NULL'
- #[ManyToOne]
- $targetEntity: \App\UI\Api\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]
Methods
__construct()
public
__construct([int|null $id = null ][, DateTime $insertTime = new DateTime() ][, DateTime|null $published = null ][, 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() ]) : mixed
Parameters
- $id : int|null = null
- $insertTime : DateTime = new DateTime()
- $published : DateTime|null = null
- $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()
addCategory()
public
addCategory(TCategory $category) : $this
Parameters
- $category : TCategory
Return values
$thisaddTranslation()
public
addTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thiscallInitMethods()
Calls `init{TraitName}()` for every used trait that defines such a method.
public
callInitMethods() : void
categoryCollectionInit()
public
categoryCollectionInit() : void
clearCategories()
public
clearCategories() : $this
Return values
$thisgetActive()
public
getActive() : 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>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>getFirstCategoryId()
public
getFirstCategoryId() : int|null
Return values
int|nullgetId()
public
getId() : int|null
Return values
int|nullgetInsertTime()
public
getInsertTime() : DateTime
Return values
DateTimegetPublished()
public
getPublished() : DateTime|null
Return values
DateTime|nullgetRegion()
public
getRegion() : object|null
Return values
object|nullgetRegionId()
public
getRegionId() : int|null
Return values
int|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|nullisActive()
public
isActive() : bool
Return values
boolisPersisted()
public
isPersisted() : bool
Return values
boolisPubliclyVisible()
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
Parameters
- $now : DateTimeInterface|null = null
Return values
boolremoveCategory()
public
removeCategory(TCategory $category) : $this
Parameters
- $category : TCategory
Return values
$thisremoveTranslation()
public
removeTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thissetActive()
public
setActive(bool $active) : $this
Parameters
- $active : bool
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
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetInsertTime()
public
setInsertTime(DateTime $insertTime) : $this
Parameters
- $insertTime : DateTime
Return values
$thissetPublished()
public
setPublished(DateTime|null $published) : $this
Parameters
- $published : DateTime|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
$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>