interface VoteResultFunctionInterface in Voting API 8.3
Provides an interface for a VoteResultFunction plugin.
Hierarchy
- interface \Drupal\votingapi\VoteResultFunctionInterface
Expanded class hierarchy of VoteResultFunctionInterface
All classes that implement VoteResultFunctionInterface
See also
\Drupal\votingapi\Annotation\VoteResultFunction
\Drupal\votingapi\VoteManager
\Drupal\votingapi\VoteResultFunctionBase
File
- src/
VoteResultFunctionInterface.php, line 13
Namespace
Drupal\votingapiView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
VoteResultFunctionInterface:: |
public | function | Performs the calculations on a set of votes to derive the result. | 4 |
VoteResultFunctionInterface:: |
public | function | Retrieve the description for the voting result. | 1 |
VoteResultFunctionInterface:: |
public | function | Retrieve the label for the voting result. | 1 |