CoolCMS API

CategoryParameterRel extends CategoryParameterRel
in package

Admin variant of the e-shop category to parameter link (`cms_mod_eshop_category_parameter_rel`).

Hydrated from api/eshop/product-category. Composite PK is the category association plus the scalar parameterId, same as CategoryParameterRel.

NOTE: the collection is not owned (no cascade, no orphanRemoval). Saving bypasses the object graph and goes through meta['parameterRels'], see CategoryParameterRelSyncTrait. The admin form does not read the relations through this collection (the Api skips it in defaultSkipFields); see ProductCategoryFormTrait. The entity only mirrors the shared layers.

Tags
extends
Attributes
#[Entity]
#[Table]
$name: 'cms_mod_eshop_category_parameter_rel'
#[TableAlias]
'categoryParameterRel'

Table of Contents

Properties

$category  : TCategory|null
$categoryId  : int|null
$order  : int
$parameterGroupId  : int|null
$parameterId  : int|null
$required  : bool
$useInSearch  : 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.
getCategory()  : TCategory|null
getCategoryId()  : int|null
getOrder()  : int
getParameterGroupId()  : int|null
getParameterId()  : int|null
getRequired()  : bool
getUseInSearch()  : bool
isRequired()  : bool
isUseInSearch()  : bool
setCategory()  : $this
setCategoryId()  : $this
setOrder()  : $this
setParameterGroupId()  : $this
setParameterId()  : $this
setRequired()  : $this
setUseInSearch()  : $this
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$category

protected TCategory|null $category = null
Attributes
#[EntityOf]
\App\UI\Admin\Eshop\Models\Entities\ProductCategory::class
#[Id]
#[Identity]
#[JoinColumn]
$name: 'cms_mod_eshop_product_categories_category_id'
$referencedColumnName: 'category_id'
$onDelete: 'CASCADE'
#[ManyToOne]
$targetEntity: \App\UI\Admin\Eshop\Models\Entities\ProductCategory::class
$inversedBy: 'parameterRels'
$fetch: 'LAZY'

$categoryId

protected int|null $categoryId = null
Attributes
#[Column]
$name: 'cms_mod_eshop_product_categories_category_id'
$type: 'integer'
$insertable: false
$updatable: false
$nullable: true
$options: ['unsigned' => true]

$parameterGroupId

protected int|null $parameterGroupId = null
Attributes
#[Column]
$name: 'cms_mod_eshop_parameter_groups_parameter_group_id'
$type: 'integer'
$nullable: true
$options: ['unsigned' => true]

$parameterId

protected int|null $parameterId = null
Attributes
#[Column]
$name: 'cms_mod_eshop_parameters_parameter_id'
$type: 'integer'
$options: ['unsigned' => true]
#[Id]
#[Identity]

$required

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

$useInSearch

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

Methods

__construct()

public __construct([mixed $category = null ][, int|null $categoryId = null ][, int|null $parameterId = null ][, int $order = 0 ][, bool $required = false ][, bool $useInSearch = false ][, int|null $parameterGroupId = null ]) : mixed
Parameters
$category : mixed = null
$categoryId : int|null = null
$parameterId : int|null = null
$order : int = 0
$required : bool = false
$useInSearch : bool = false
$parameterGroupId : int|null = null

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>

setCategory()

public setCategory(TCategory|null $category) : $this
Parameters
$category : TCategory|null
Return values
$this

setCategoryId()

public setCategoryId(int|null $categoryId) : $this
Parameters
$categoryId : int|null
Return values
$this

setOrder()

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

setParameterGroupId()

public setParameterGroupId(int|null $parameterGroupId) : $this
Parameters
$parameterGroupId : int|null
Return values
$this

setParameterId()

public setParameterId(int|null $parameterId) : $this
Parameters
$parameterId : int|null
Return values
$this

setRequired()

public setRequired(bool $required) : $this
Parameters
$required : bool
Return values
$this

setUseInSearch()

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