You are here

interface VoteResultFunctionInterface in Voting API 8.3

Provides an interface for a VoteResultFunction plugin.

Hierarchy

Expanded class hierarchy of VoteResultFunctionInterface

All classes that implement VoteResultFunctionInterface

See also

\Drupal\votingapi\Annotation\VoteResultFunction

\Drupal\votingapi\VoteManager

\Drupal\votingapi\VoteResultFunctionBase

Plugin API

File

src/VoteResultFunctionInterface.php, line 13

Namespace

Drupal\votingapi
View source
interface VoteResultFunctionInterface {

  /**
   * Retrieve the label for the voting result.
   *
   * @return string
   *   The translated label
   */
  public function getLabel();

  /**
   * Retrieve the description for the voting result.
   *
   * @return string
   *   The translated description
   */
  public function getDescription();

  /**
   * Performs the calculations on a set of votes to derive the result.
   *
   * @param \Drupal\votingapi\Entity\Vote[] $votes
   *   An array of Vote entities.
   *
   * @return int
   *   A result based on the supplied votes.
   */
  public function calculateResult($votes);

}

Members

Namesort descending Modifiers Type Description Overrides
VoteResultFunctionInterface::calculateResult public function Performs the calculations on a set of votes to derive the result. 4
VoteResultFunctionInterface::getDescription public function Retrieve the description for the voting result. 1
VoteResultFunctionInterface::getLabel public function Retrieve the label for the voting result. 1