public function Poll::getOptionValues in Poll 8
Get the values of each vote option for this poll.
Return value
array Associative array of option values.
Overrides PollInterface::getOptionValues
File
- src/
Entity/ Poll.php, line 406
Class
- Poll
- Defines the poll entity class.
Namespace
Drupal\poll\EntityCode
public function getOptionValues() {
$options = array();
if (count($this->choice)) {
foreach ($this->choice as $choice_item) {
$options[$choice_item->target_id] = 1;
}
}
return $options;
}