protected function ApprovalPollViewForm::getMaxChoices in Advanced Poll 8
Get max choices for the poll or 0.
Return value
int
2 calls to ApprovalPollViewForm::getMaxChoices()
- ApprovalPollViewForm::buildForm in src/
Form/ ApprovalPollViewForm.php - Form constructor.
- ApprovalPollViewForm::validateVote in src/
Form/ ApprovalPollViewForm.php - Validates the vote action.
File
- src/
Form/ ApprovalPollViewForm.php, line 335
Class
- ApprovalPollViewForm
- Class ApprovalPollViewForm
Namespace
Drupal\advpoll\FormCode
protected function getMaxChoices() {
$maxChoices = 0;
if ($this->poll
->hasField('field_number_of_votes') && !$this->poll
->get('field_number_of_votes')
->isEmpty()) {
$maxChoices = $this->poll
->get('field_number_of_votes')->value;
}
return $maxChoices;
}