CoolCMS API

CategoryParameterRel extends CategoryParameterRel
in package

Admin variant of the category-to-parameter link, hydrated from `api/bazaar/category-parameter-rel`.

Targets a parameter at a category: which parameter (parameterId), in which group (parameterGroupId), required or searchable, and the order. Parameter options are separate rows with parameterGroupId null.

The composite PK is the category association plus the scalar parameterId. The column categoryId is read-only (insertable: false) in the Shared base; the category association owns the column. Mirrors CategoryParameterRel.

Tags
extends
Attributes
#[Entity]
#[Table]
$name: 'cms_mod_bazaar_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\Bazaar\Models\Entities\Category::class
#[Id]
#[Identity]
#[JoinColumn]
$name: 'cms_mod_bazaar_categories_category_id'
$referencedColumnName: 'category_id'
$onDelete: 'CASCADE'
#[ManyToOne]
$targetEntity: \App\UI\Admin\Bazaar\Models\Entities\Category::class
$inversedBy: 'categoryParameterRels'
$fetch: 'LAZY'

$categoryId

protected int|null $categoryId = null
Attributes
#[Column]
$name: 'cms_mod_bazaar_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_bazaar_parameter_groups_parameter_group_id'
$type: 'integer'
$nullable: true
$options: ['unsigned' => true]

$parameterId

protected int|null $parameterId = null
Attributes
#[Column]
$name: 'cms_mod_bazaar_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 = true
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 = true ][, 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 = true
$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