CoolCMS API

ProductSetImageRel extends ProductSetImageRel
in package

Link between `ProductSet` and an image with ordering (gallery, drag and drop), same as Blog `GalleryAssetRel` with `ProductSet` in the gallery role. Composite PK (set + image); the concrete `#[ORM\Id]` and many-to-one come from the Api/Admin leaf. Images are saved by hard delete + insert (`afterSave()`); there is no soft delete.

Tags
extends
Attributes
#[Entity]
#[Table]
$name: 'cms_mod_eshop_product_set_image_relations'
#[TableAlias]
'productSetImageRel'

Table of Contents

Properties

$asset  : TImage|null
$order  : int
$productSet  : TProductSet|null

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
getId()  : int|null
Set id without triggering lazy loading (for grouping relations).
getImageId()  : int|null
Image id without triggering lazy loading (proxy object).
getOrder()  : int
getProductSet()  : TProductSet|null
isMain()  : bool
The main image is the first in order (database default `order` = 1).
isRemoved()  : bool
Gallery rows are hard-deleted (delete + insert); no soft delete (`AssetRelCollectionTrait` contract).
setAsset()  : $this
setOrder()  : $this
setProductSet()  : $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

$order

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

$productSet

protected TProductSet|null $productSet = null
Attributes
#[EntityOf]
\App\UI\Front\Eshop\Models\Entities\ProductSet::class
#[Id]
#[Identity]
#[JoinColumn]
$name: 'cms_mod_eshop_product_sets_product_set_id'
$referencedColumnName: 'product_set_id'
$onDelete: 'CASCADE'
#[ManyToOne]
$targetEntity: \App\UI\Front\Eshop\Models\Entities\ProductSet::class
$inversedBy: 'assetRels'

Methods

__construct()

public __construct([mixed $productSet = null ][, mixed $asset = null ][, int $order = 1 ]) : mixed
Parameters
$productSet : mixed = null
$asset : mixed = null
$order : int = 1

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>

getId()

Set id without triggering lazy loading (for grouping relations).

public getId() : int|null
Return values
int|null

getImageId()

Image id without triggering lazy loading (proxy object).

public getImageId() : int|null
Return values
int|null

getProductSet()

public getProductSet() : TProductSet|null
Return values
TProductSet|null

isMain()

The main image is the first in order (database default `order` = 1).

public isMain() : bool
Return values
bool

isRemoved()

Gallery rows are hard-deleted (delete + insert); no soft delete (`AssetRelCollectionTrait` contract).

public isRemoved() : bool
Return values
bool

setAsset()

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

setOrder()

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

setProductSet()

public setProductSet(TProductSet|null $productSet) : $this
Parameters
$productSet : TProductSet|null
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