Reference
extends Reference
in package
Reference project: a showcase card for the website (client, photo, description, quote).
Tags
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_mod_company_references'
- #[TableAlias]
- 'reference'
Table of Contents
Properties
- $assetRels : Collection<int, ReferenceAssetRel>
- $categories : Collection<int, Category>
- $clientName : string|null
- $companyId : int
- $deleted : bool
- $featured : bool
- $id : int|null
- $imageId : int|null
- $inList : bool
- $inLogos : bool
- $logoId : int|null
- $order : int
- $public : bool
- $realizedDate : DateTime|null
- $translations : Collection<int, ReferenceText>
- $url : string|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
- 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>
- getClientName() : string|null
- getCompanyId() : int
- getDeleted() : bool
- getFeatured() : bool
- getFirstCategoryId() : int|null
- getId() : int|null
- getImageId() : int|null
- getInList() : bool
- getInLogos() : bool
- getLogoId() : int|null
- getMainAsset() : Asset|null
- getOrder() : int
- getPublic() : bool
- getRealizedDate() : DateTime|null
- getTranslation() : TTranslation|null
- getTranslations() : Collection<int, TTranslation>
- getUrl() : string|null
- isDeleted() : bool
- isFeatured() : bool
- isInList() : bool
- isInLogos() : bool
- isPersisted() : bool
- isPublic() : bool
- removeAssetRel() : $this
- removeCategory() : $this
- removeTranslation() : $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
- setClientName() : $this
- setCompanyId() : $this
- setDeleted() : $this
- setFeatured() : $this
- setId() : $this
- setImageId() : $this
- setInList() : $this
- setInLogos() : $this
- setLogoId() : $this
- setOrder() : $this
- setPublic() : $this
- setRealizedDate() : $this
- setTranslations() : $this
- setUrl() : $this
- translationCollectionInit() : void
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$assetRels
protected
Collection<int, ReferenceAssetRel>
$assetRels
Attributes
- #[OneToMany]
- $targetEntity: \App\UI\Api\Company\Models\Entities\ReferenceAssetRel::class
- $mappedBy: 'reference'
- $cascade: ["persist", "remove"]
- $orphanRemoval: true
- $fetch: "LAZY"
$categories
protected
Collection<int, Category>
$categories
Attributes
- #[JoinTable]
- $name: 'cms_mod_company_reference_category_relations'
- $joinColumns: [new \Doctrine\ORM\Mapping\JoinColumn(name: 'cms_mod_company_references_reference_id', referencedColumnName: 'reference_id', onDelete: 'CASCADE')]
- $inverseJoinColumns: [new \Doctrine\ORM\Mapping\JoinColumn(name: 'cms_mod_company_categories_category_id', referencedColumnName: 'category_id', onDelete: 'CASCADE')]
- #[ManyToMany]
- $targetEntity: \App\UI\Api\Company\Models\Entities\Category::class
- $fetch: "LAZY"
$clientName
protected
string|null
$clientName
= null
Attributes
- #[Column]
- $name: 'client_name'
- $type: 'string'
- $length: 255
- $nullable: true
$companyId
protected
int
$companyId
= 0
Attributes
- #[Column]
- $name: 'company_id'
- $type: 'integer'
- $options: ['unsigned' => true]
$deleted
protected
bool
$deleted
= false
Attributes
- #[Column]
- $name: 'deleted'
- $type: 'boolean'
$featured
protected
bool
$featured
= false
Attributes
- #[Column]
- $name: 'featured'
- $type: 'boolean'
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'reference_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$imageId
protected
int|null
$imageId
= null
Attributes
- #[Column]
- $name: 'image_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- $nullable: true
$inList
protected
bool
$inList
= true
Attributes
- #[Column]
- $name: 'in_list'
- $type: 'boolean'
$inLogos
protected
bool
$inLogos
= false
Attributes
- #[Column]
- $name: 'in_logos'
- $type: 'boolean'
$logoId
protected
int|null
$logoId
= null
Attributes
- #[Column]
- $name: 'logo_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- $nullable: true
$order
protected
int
$order
= 0
Attributes
- #[Column]
- $name: '`order`'
- $type: 'integer'
- $options: ['unsigned' => true, 'default' => 0]
$public
protected
bool
$public
= true
Attributes
- #[Column]
- $name: 'public'
- $type: 'boolean'
$realizedDate
protected
DateTime|null
$realizedDate
= null
Attributes
- #[Column]
- $name: 'realized_date'
- $type: 'date'
- $nullable: true
$translations
protected
Collection<int, ReferenceText>
$translations
Attributes
- #[OneToMany]
- $targetEntity: \App\UI\Api\Company\Models\Entities\ReferenceText::class
- $mappedBy: 'parent'
- $cascade: ["persist", "remove"]
- $orphanRemoval: true
- $fetch: "LAZY"
$url
protected
string|null
$url
= null
Attributes
- #[Column]
- $name: 'url'
- $type: 'string'
- $length: 255
- $nullable: true
Methods
__construct()
public
__construct([int|null $id = null ][, int $companyId = 0 ][, string|null $clientName = null ][, DateTime|null $realizedDate = null ][, string|null $url = null ][, int|null $imageId = null ][, int|null $logoId = null ][, int $order = 0 ][, bool $public = true ][, bool $inLogos = false ][, bool $inList = true ][, bool $featured = false ][, bool $deleted = false ][, Collection $assetRels = new ArrayCollection() ][, Collection $categories = new ArrayCollection() ]) : mixed
Parameters
- $id : int|null = null
- $companyId : int = 0
- $clientName : string|null = null
- $realizedDate : DateTime|null = null
- $url : string|null = null
- $imageId : int|null = null
- $logoId : int|null = null
- $order : int = 0
- $public : bool = true
- $inLogos : bool = false
- $inList : bool = true
- $featured : bool = false
- $deleted : bool = false
- $assetRels : Collection = new ArrayCollection()
- $categories : Collection = new ArrayCollection()
addAssetRel()
public
addAssetRel(TAssetRel $assetRel) : $this
Parameters
- $assetRel : TAssetRel
Return values
$thisaddCategory()
public
addCategory(TCategory $category) : $this
Parameters
- $category : TCategory
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
categoryCollectionInit()
public
categoryCollectionInit() : void
clearCategories()
public
clearCategories() : $this
Return values
$thisgetAllTraits()
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>getClientName()
public
getClientName() : string|null
Return values
string|nullgetCompanyId()
public
getCompanyId() : int
Return values
intgetDeleted()
public
getDeleted() : bool
Return values
boolgetFeatured()
public
getFeatured() : bool
Return values
boolgetFirstCategoryId()
public
getFirstCategoryId() : int|null
Return values
int|nullgetId()
public
getId() : int|null
Return values
int|nullgetImageId()
public
getImageId() : int|null
Return values
int|nullgetInList()
public
getInList() : bool
Return values
boolgetInLogos()
public
getInLogos() : bool
Return values
boolgetLogoId()
public
getLogoId() : int|null
Return values
int|nullgetMainAsset()
public
getMainAsset() : Asset|null
Return values
Asset|null —main image (else the first non-removed one)
getOrder()
public
getOrder() : int
Return values
intgetPublic()
public
getPublic() : bool
Return values
boolgetRealizedDate()
public
getRealizedDate() : 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>getUrl()
public
getUrl() : string|null
Return values
string|nullisDeleted()
public
isDeleted() : bool
Return values
boolisFeatured()
public
isFeatured() : bool
Return values
boolisInList()
public
isInList() : bool
Return values
boolisInLogos()
public
isInLogos() : bool
Return values
boolisPersisted()
public
isPersisted() : bool
Return values
boolisPublic()
public
isPublic() : bool
Return values
boolremoveAssetRel()
public
removeAssetRel(TAssetRel $assetRel) : $this
Parameters
- $assetRel : TAssetRel
Return values
$thisremoveCategory()
public
removeCategory(TCategory $category) : $this
Parameters
- $category : TCategory
Return values
$thisremoveTranslation()
public
removeTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
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
$thissetCategories()
public
setCategories(Collection<int, TCategory>|array<int, TCategory> $categories) : $this
Parameters
- $categories : Collection<int, TCategory>|array<int, TCategory>
Return values
$thissetClientName()
public
setClientName(string|null $clientName) : $this
Parameters
- $clientName : string|null
Return values
$thissetCompanyId()
public
setCompanyId(int $companyId) : $this
Parameters
- $companyId : int
Return values
$thissetDeleted()
public
setDeleted(bool $deleted) : $this
Parameters
- $deleted : bool
Return values
$thissetFeatured()
public
setFeatured(bool $featured) : $this
Parameters
- $featured : bool
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetImageId()
public
setImageId(int|null $imageId) : $this
Parameters
- $imageId : int|null
Return values
$thissetInList()
public
setInList(bool $inList) : $this
Parameters
- $inList : bool
Return values
$thissetInLogos()
public
setInLogos(bool $inLogos) : $this
Parameters
- $inLogos : bool
Return values
$thissetLogoId()
public
setLogoId(int|null $logoId) : $this
Parameters
- $logoId : int|null
Return values
$thissetOrder()
public
setOrder(int $order) : $this
Parameters
- $order : int
Return values
$thissetPublic()
public
setPublic(bool $public) : $this
Parameters
- $public : bool
Return values
$thissetRealizedDate()
public
setRealizedDate(DateTime|null $realizedDate) : $this
Parameters
- $realizedDate : 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
$thissetUrl()
public
setUrl(string|null $url) : $this
Parameters
- $url : string|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>