PollAnswer
extends PollAnswer
in package
Admin variant of a poll answer (`cms_mod_base_poll_answers`), owned by `Poll::$answers`.
The answer text is stored in translations.
Tags
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_mod_base_poll_answers'
- #[TableAlias]
- 'pollAnswer'
Table of Contents
Properties
Methods
- __construct() : mixed
- addTranslation() : $this
- 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.
- getCount() : int
- getId() : int|null
- getOrder() : int
- getPoll() : Poll|null
- getPollId() : int
- getTranslation() : TTranslation|null
- getTranslations() : Collection<int, TTranslation>
- isPersisted() : bool
- removeTranslation() : $this
- setCount() : $this
- setId() : $this
- setOrder() : $this
- setPoll() : self
- setPollId() : $this
- setTranslations() : $this
- translationCollectionInit() : void
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$count
protected
int
$count
= 0
Attributes
- #[Column]
- $name: 'count'
- $type: 'integer'
- $options: ['unsigned' => true, 'default' => 0]
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'poll_answer_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$order
protected
int
$order
= 0
Attributes
- #[Column]
- $name: '`order`'
- $type: 'integer'
- $options: ['unsigned' => true, 'default' => 0]
$poll
protected
Poll|null
$poll
= null
Attributes
- #[EntityOf]
- \App\UI\Admin\Base\Models\Entities\Poll::class
- #[JoinColumn]
- $name: 'cms_mod_base_polls_poll_id'
- $referencedColumnName: 'poll_id'
- $onDelete: 'CASCADE'
- #[ManyToOne]
- $targetEntity: \App\UI\Admin\Base\Models\Entities\Poll::class
- $inversedBy: 'answers'
- #[ParentRef]
$pollId
protected
int
$pollId
= 0
Attributes
- #[Column]
- $name: 'cms_mod_base_polls_poll_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- $insertable: false
- $updatable: false
$translations
protected
Collection
$translations
Attributes
- #[CollectionOf]
- \App\UI\Admin\Base\Models\Entities\PollAnswerText::class
- $owned: true
- #[OneToMany]
- $targetEntity: \App\UI\Admin\Base\Models\Entities\PollAnswerText::class
- $mappedBy: 'parent'
- $cascade: ["persist", "remove"]
- $orphanRemoval: true
- $fetch: "LAZY"
Methods
__construct()
public
__construct([int|null $id = null ][, int $pollId = 0 ][, int $count = 0 ][, int $order = 0 ][, Collection $translations = new ArrayCollection() ]) : mixed
Parameters
- $id : int|null = null
- $pollId : int = 0
- $count : int = 0
- $order : int = 0
- $translations : Collection = new ArrayCollection()
addTranslation()
public
addTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thiscallInitMethods()
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>getCount()
public
getCount() : int
Return values
intgetId()
public
getId() : int|null
Return values
int|nullgetOrder()
public
getOrder() : int
Return values
intgetPoll()
public
getPoll() : Poll|null
Return values
Poll|nullgetPollId()
public
getPollId() : int
Return values
intgetTranslation()
public
getTranslation(int $langId) : TTranslation|null
Parameters
- $langId : int
Return values
TTranslation|nullgetTranslations()
public
getTranslations() : Collection<int, TTranslation>
Return values
Collection<int, TTranslation>isPersisted()
public
isPersisted() : bool
Return values
boolremoveTranslation()
public
removeTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thissetCount()
public
setCount(int $count) : $this
Parameters
- $count : int
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetOrder()
public
setOrder(int $order) : $this
Parameters
- $order : int
Return values
$thissetPoll()
public
setPoll(Poll|null $poll) : self
Parameters
- $poll : Poll|null
Return values
selfsetPollId()
public
setPollId(int $pollId) : $this
Parameters
- $pollId : int
Return values
$thissetTranslations()
public
setTranslations(Collection<int, TTranslation>|array<int, TTranslation> $translations) : $this
Parameters
- $translations : Collection<int, TTranslation>|array<int, TTranslation>
Return values
$thistranslationCollectionInit()
public
translationCollectionInit() : void
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>