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
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
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
$category
protected
TCategory|null
$category
= null
$feed
protected
TFeed|null
$feed
= null
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'feed_product_category_rel_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$value
protected
string
$value
= ''
Attributes
- #[Column]
- $name: 'value'
- $type: 'text'
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>getCategory()
public
getCategory() : TCategory|null
Return values
TCategory|nullgetFeed()
public
getFeed() : TFeed|null
Return values
TFeed|nullgetId()
public
getId() : int|null
Return values
int|nullgetValue()
public
getValue() : string
Return values
stringisPersisted()
public
isPersisted() : bool
Return values
boolsetCategory()
public
setCategory(TCategory|null $category) : $this
Parameters
- $category : TCategory|null
Return values
$thissetFeed()
public
setFeed(TFeed|null $feed) : $this
Parameters
- $feed : TFeed|null
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetValue()
public
setValue(string $value) : $this
Parameters
- $value : string
Return values
$thisgetTraitsRecursive()
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>