Documentation

PollOption
in package
implements ResourceInterface uses IdentifiableTrait

Poll Option.

Attributes
#[Entity]

Table of Contents

Interfaces

ResourceInterface

Properties

$anonymousVotes  : int
$id  : int|null
The default value must be `null` to prevent issues with auto generating the value. The column is strictly not nullable.
$poll  : Poll
Referenced poll.
$text  : FrontpageLocalisedText
The localised text for this option.
$votes  : Collection<string|int, PollVote>
Votes for this option.

Methods

addVote()  : void
Adds a new vote for this poll option.
getAnonymousVotes()  : int
getId()  : int|null
Get the identifier of the object.
getPoll()  : Poll
getResourceId()  : string
Get the resource ID.
getText()  : FrontpageLocalisedText
getVotesCount()  : int
Get the number of votes for this poll option.
setAnonymousVotes()  : void
setId()  : void
Setting the identifier manually will, in most instances, result in undefined behaviour. Use with caution!
setPoll()  : void
setText()  : void

Properties

$anonymousVotes

protected int $anonymousVotes = 0
Attributes
#[Column]
$type: 'integer'
$options: ['default' => 0]

$id

The default value must be `null` to prevent issues with auto generating the value. The column is strictly not nullable.

protected int|null $id = null
Attributes
#[Column]
$type: 'integer'
#[GeneratedValue]
$strategy: 'IDENTITY'
#[Id]

$poll

Referenced poll.

protected Poll $poll
Attributes
#[JoinColumn]
$name: 'poll_id'
$referencedColumnName: 'id'
$nullable: false
#[ManyToOne]
$targetEntity: \Frontpage\Model\Poll::class
$inversedBy: 'options'
$cascade: ['persist']

$text

The localised text for this option.

protected FrontpageLocalisedText $text
Attributes
#[JoinColumn]
$name: 'text_id'
$referencedColumnName: 'id'
$nullable: false
#[OneToOne]
$targetEntity: \Frontpage\Model\FrontpageLocalisedText::class
$cascade: ['persist', 'remove']
$orphanRemoval: true

$votes

Votes for this option.

protected Collection<string|int, PollVote> $votes
Attributes
#[OneToMany]
$targetEntity: \Frontpage\Model\PollVote::class
$mappedBy: 'pollOption'
$cascade: ['persist', 'remove']
$fetch: 'EXTRA_LAZY'

Methods

getAnonymousVotes()

public getAnonymousVotes() : int
Return values
int

getId()

Get the identifier of the object.

public getId() : int|null
Tags
psalm-ignore-nullable-return
Return values
int|null

getResourceId()

Get the resource ID.

public getResourceId() : string
Return values
string

getVotesCount()

Get the number of votes for this poll option.

public getVotesCount() : int
Return values
int

setAnonymousVotes()

public setAnonymousVotes(int $anonymousVotes) : void
Parameters
$anonymousVotes : int

setId()

Setting the identifier manually will, in most instances, result in undefined behaviour. Use with caution!

public setId(int|null $id) : void
Parameters
$id : int|null

        
On this page

Search results