You are here

public function PollChoice::setChoice in Poll 8

Sets the choice for the poll choice.

Parameters

string $choice: The poll choice.

Return value

static The class instance that this method is called on.

Overrides PollChoiceInterface::setChoice

File

src/Entity/PollChoice.php, line 43

Class

PollChoice
Defines the poll choice entity class.

Namespace

Drupal\poll\Entity

Code

public function setChoice($question) {
  $this
    ->set('choice', $question);
  return $this;
}