Poll
in package
implements
ResourceInterface
uses
IdentifiableTrait
Poll.
Tags
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
addComment()
Add a comment to the poll.
public
addComment(PollComment $comment) : void
Parameters
- $comment : PollComment
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
getApprover()
public
getApprover() : Member|null
Return values
Member|nullgetComments()
public
getComments() : Collection<string|int, PollComment>
Return values
Collection<string|int, PollComment>getCreator()
public
getCreator() : Member
Return values
MembergetExpiryDate()
public
getExpiryDate() : DateTime
Return values
DateTimegetId()
Get the identifier of the object.
public
getId() : int|null
Tags
Return values
int|nullgetOptions()
public
getOptions() : Collection<string|int, PollOption>
Return values
Collection<string|int, PollOption>getQuestion()
public
getQuestion() : FrontpageLocalisedText
Return values
FrontpageLocalisedTextgetResourceId()
Get the resource ID.
public
getResourceId() : string
Return values
stringisActive()
Check to see if the poll is currently displayed.
public
isActive() : bool
Return values
boolisApproved()
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
setQuestion()
public
setQuestion(FrontpageLocalisedText $question) : void
Parameters
- $question : FrontpageLocalisedText
toGdprArray()
public
toGdprArray() : PollGdprArrayType