CoolCMS API

FeedProductCategoryRel extends BaseEntity
in package
implements IdentifiableInterface uses IdentifiableTrait

AbstractYes

Textual mapping of a category to a value per feed (used by the `getCategories` action).

Surrogate PK instead of a composite one: a composite PK made of two associations on an owned collection is fragile. UNIQUE(feed_id, category_id) keeps the natural uniqueness.

Unlike FeedParameter and FeedParameterRel this entity is an owned collection of Feed (categoryRels): it has a direct FK to the feed and no self-reference, so the generic object-graph save handles it (like Gift::$offerSets).

Tags
template
Attributes
#[MappedSuperclass]
#[TableAlias]
$alias: 'feedProductCategoryRel'

Table of Contents

Interfaces

IdentifiableInterface
Entity with a simple integer primary key. Most entities have one (often via {@see \App\Core\Traits\Shared\Models\Entities\IdentifiableTrait}); texts and links with a composite key do not, which is why `getId()` is not on {@see \App\Core\Base\BaseEntity}. Code that needs the id of a generic entity asks for this interface (parameter type, template bound, `instanceof`).

Properties

$category  : TCategory|null
$feed  : TFeed|null
$id  : int|null
$value  : string

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
getFeed()  : TFeed|null
getId()  : int|null
getValue()  : string
isPersisted()  : bool
setCategory()  : $this
setFeed()  : $this
setId()  : $this
setValue()  : $this
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$id

protected int|null $id = null
Attributes
#[Column]
$name: 'feed_product_category_rel_id'
$type: 'integer'
$options: ['unsigned' => true]
#[GeneratedValue]
#[Id]

Methods

__construct()

public __construct([int|null $id = null ][, mixed $feed = null ][, mixed $category = null ][, string $value = '' ]) : mixed
Parameters
$id : int|null = null
$feed : mixed = null
$category : mixed = null
$value : string = ''

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

setFeed()

public setFeed(TFeed|null $feed) : $this
Parameters
$feed : TFeed|null
Return values
$this

setId()

public setId(int|null $id) : $this
Parameters
$id : int|null
Return values
$this

setValue()

public setValue(string $value) : $this
Parameters
$value : string
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