PollPlace
extends PollPlace
in package
Admin variant of a poll place (`cms_mod_base_poll_places`), hydrated through the ApiBridge from the `api/base/poll-place` endpoint.
Polls are related through the join entity PollPlaceRel (pollRels, an owned
collection ordered by order). Saving the poll place stores the drag&drop order of polls
in order.
Tags
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_mod_base_poll_places'
- #[TableAlias]
- 'pollPlace'
Table of Contents
Properties
Methods
- __construct() : mixed
- addPollRel() : $this
- callInitMethods() : void
- Calls `init{TraitName}()` for every used trait that defines such a method.
- getActivePolls() : Collection<int, TPoll>
- Linked polls the website shows: a disabled poll (`active` off) is left out, it does not accept votes either.
- getAllTraits() : array<string, string>
- Returns all traits the class uses, including those used by parent classes and nested traits.
- getId() : int|null
- getName() : string
- getPollRels() : Collection<int, TRel>
- getPolls() : Collection<int, TPoll>
- BC: the linked polls, extracted from `pollRels` in `order` order.
- isPersisted() : bool
- setId() : $this
- setName() : $this
- setPollRels() : $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: 'poll_place_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$name
protected
string
$name
= ''
Attributes
- #[Column]
- $name: 'name'
- $type: 'string'
- $length: 255
$pollRels
protected
Collection
$pollRels
Attributes
- #[CollectionOf]
- \App\UI\Admin\Base\Models\Entities\PollPlaceRel::class
- $owned: true
- #[OneToMany]
- $targetEntity: \App\UI\Admin\Base\Models\Entities\PollPlaceRel::class
- $mappedBy: 'pollPlace'
- $cascade: ["persist", "remove"]
- $orphanRemoval: true
- $fetch: "LAZY"
- #[OrderBy]
- ['order' => 'ASC']
Methods
__construct()
public
__construct([int|null $id = null ][, string $name = '' ]) : mixed
Parameters
- $id : int|null = null
- $name : string = ''
addPollRel()
public
addPollRel(TRel $rel) : $this
Parameters
- $rel : TRel
Return values
$thiscallInitMethods()
Calls `init{TraitName}()` for every used trait that defines such a method.
public
callInitMethods() : void
getActivePolls()
Linked polls the website shows: a disabled poll (`active` off) is left out, it does not accept votes either.
public
getActivePolls() : Collection<int, TPoll>
Return values
Collection<int, TPoll>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>getId()
public
getId() : int|null
Return values
int|nullgetName()
public
getName() : string
Return values
stringgetPollRels()
public
getPollRels() : Collection<int, TRel>
Return values
Collection<int, TRel>getPolls()
BC: the linked polls, extracted from `pollRels` in `order` order.
public
getPolls() : Collection<int, TPoll>
Return values
Collection<int, TPoll>isPersisted()
public
isPersisted() : bool
Return values
boolsetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetName()
public
setName(string $name) : $this
Parameters
- $name : string
Return values
$thissetPollRels()
public
setPollRels(Collection<int, TRel>|array<int, TRel> $pollRels) : $this
Parameters
- $pollRels : Collection<int, TRel>|array<int, TRel>
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>