CoolCMS API

ReferenceAssetRel extends ReferenceAssetRel
in package

Front end variant of the link between a reference and a gallery item (join `cms_mod_company_reference_image_rel`).

The primary key is composite (reference + asset); order, main and removed come from the Shared parent. Writes are driven by the Api afterSave hook through meta['orderedAssets'].

Tags
extends
Attributes
#[Entity]
#[Table]
$name: 'cms_mod_company_reference_image_rel'
#[TableAlias]
'referenceImageRel'

Table of Contents

Properties

$asset  : TImage|null
$main  : bool
$order  : int
$reference  : TReference|null
$removed  : bool

Methods

__construct()  : mixed
callInitMethods()  : void
Calls `init{TraitName}()` for every used trait that defines such a method.
getAllTraits()  : array<string, string>
Returns all traits the class uses, including those used by parent classes and nested traits.
getAsset()  : TImage|null
getMain()  : bool
getOrder()  : int
getReference()  : TReference|null
getRemoved()  : bool
isMain()  : bool
isRemoved()  : bool
setAsset()  : $this
setMain()  : $this
setOrder()  : $this
setReference()  : $this
setRemoved()  : $this
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$asset

protected TImage|null $asset = null
Attributes
#[EntityOf]
\App\UI\Front\System\Models\Entities\Asset::class
#[Id]
#[Identity]
#[JoinColumn]
$name: 'cms_system_images_image_id'
$referencedColumnName: 'image_id'
$onDelete: 'CASCADE'
#[ManyToOne]
$targetEntity: \App\UI\Front\System\Models\Entities\Asset::class

$main

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

$order

protected int $order = 0
Attributes
#[Column]
$name: '`order`'
$type: 'integer'
$options: ['unsigned' => true]

$reference

protected TReference|null $reference = null
Attributes
#[EntityOf]
\App\UI\Front\Company\Models\Entities\Reference::class
#[Id]
#[Identity]
#[JoinColumn]
$name: 'cms_mod_company_references_reference_id'
$referencedColumnName: 'reference_id'
$onDelete: 'CASCADE'
#[ManyToOne]
$targetEntity: \App\UI\Front\Company\Models\Entities\Reference::class
$inversedBy: 'assetRels'

$removed

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

Methods

__construct()

public __construct([mixed $reference = null ][, mixed $asset = null ][, bool $main = false ][, bool $removed = false ][, int $order = 0 ]) : mixed
Parameters
$reference : mixed = null
$asset : mixed = null
$main : bool = false
$removed : bool = false
$order : int = 0

callInitMethods()

Calls `init{TraitName}()` for every used trait that defines such a method.

public callInitMethods() : void

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>

getReference()

public getReference() : TReference|null
Return values
TReference|null

setAsset()

public setAsset(TImage|null $asset) : $this
Parameters
$asset : TImage|null
Return values
$this

setMain()

public setMain(bool $main) : $this
Parameters
$main : bool
Return values
$this

setOrder()

public setOrder(int $order) : $this
Parameters
$order : int
Return values
$this

setReference()

public setReference(TReference|null $reference) : $this
Parameters
$reference : TReference|null
Return values
$this

setRemoved()

public setRemoved(bool $removed) : $this
Parameters
$removed : bool
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