Documentation

Poll
in package
implements ResourceInterface uses IdentifiableTrait

Poll.

Tags
psalm-import-type

LocalisedTextGdprArrayType from LocalisedTextModel as ImportedLocalisedTextGdprArrayType

psalm-type

PollGdprArrayType = array{ id: int, expiryDate: string, question: ImportedLocalisedTextGdprArrayType, options: array<array-key, array{ id: int, value: ImportedLocalisedTextGdprArrayType, }>, }

Attributes
#[Entity]

Table of Contents

Interfaces

ResourceInterface

Properties

$approver  : Member|null
Who approved this poll. If null then nobody approved it.
$comments  : Collection<string|int, PollComment>
Poll comments.
$creator  : Member
Who approved this poll. If null then nobody approved it.
$expiryDate  : DateTime
The date the poll expires.
$id  : int|null
The default value must be `null` to prevent issues with auto generating the value. The column is strictly not nullable.
$options  : Collection<string|int, PollOption>
Poll options.
$question  : FrontpageLocalisedText
The localised question for the poll.

Methods

__construct()  : mixed
addComment()  : void
Add a comment to the poll.
addComments()  : void
Add comments to the poll.
addOptions()  : void
Adds options to the poll.
getApprover()  : Member|null
getComments()  : Collection<string|int, PollComment>
getCreator()  : Member
getExpiryDate()  : DateTime
getId()  : int|null
Get the identifier of the object.
getOptions()  : Collection<string|int, PollOption>
getQuestion()  : FrontpageLocalisedText
getResourceId()  : string
Get the resource ID.
isActive()  : bool
Check to see if the poll is currently displayed.
isApproved()  : bool
Check to see if the poll is approved. <br> If no-one approved this poll, this poll is not approved.
removeOptions()  : void
Removes options from the poll.
setApprover()  : void
setCreator()  : void
setExpiryDate()  : void
setId()  : void
Setting the identifier manually will, in most instances, result in undefined behaviour. Use with caution!
setQuestion()  : void
toGdprArray()  : PollGdprArrayType

Properties

$approver

Who approved this poll. If null then nobody approved it.

protected Member|null $approver = null
Attributes
#[JoinColumn]
$referencedColumnName: 'lidnr'
#[ManyToOne]
$targetEntity: \Decision\Model\Member::class

$comments

Poll comments.

protected Collection<string|int, PollComment> $comments
Attributes
#[OneToMany]
$targetEntity: \Frontpage\Model\PollComment::class
$mappedBy: 'poll'
$cascade: ['persist', 'remove']

$creator

Who approved this poll. If null then nobody approved it.

protected Member $creator
Attributes
#[JoinColumn]
$referencedColumnName: 'lidnr'
$nullable: false
#[ManyToOne]
$targetEntity: \Decision\Model\Member::class

$expiryDate

The date the poll expires.

protected DateTime $expiryDate
Attributes
#[Column]
$type: 'date'

$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]

$options

Poll options.

protected Collection<string|int, PollOption> $options
Attributes
#[OneToMany]
$targetEntity: \Frontpage\Model\PollOption::class
$mappedBy: 'poll'
$cascade: ['persist', 'remove']

$question

The localised question for the poll.

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

Methods

__construct()

public __construct() : mixed

addComments()

Add comments to the poll.

public addComments(array<string|int, PollComment$comments) : void
Parameters
$comments : array<string|int, PollComment>

addOptions()

Adds options to the poll.

public addOptions(ArrayCollection $options) : void
Parameters
$options : ArrayCollection

getExpiryDate()

public getExpiryDate() : DateTime
Return values
DateTime

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

isActive()

Check to see if the poll is currently displayed.

public isActive() : bool
Return values
bool

isApproved()

Check to see if the poll is approved. <br> If no-one approved this poll, this poll is not approved.

public isApproved() : bool
Return values
bool

true if poll is approved; false otherwise

removeOptions()

Removes options from the poll.

public removeOptions(ArrayCollection $options) : void
Parameters
$options : ArrayCollection

setApprover()

public setApprover(Member $approver) : void
Parameters
$approver : Member

setCreator()

public setCreator(Member $creator) : void
Parameters
$creator : Member

setExpiryDate()

public setExpiryDate(DateTime $expiryDate) : void
Parameters
$expiryDate : DateTime

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

toGdprArray()

public toGdprArray() : PollGdprArrayType
Return values
PollGdprArrayType

        
On this page

Search results