You are here

public function VoteResultFunctionInterface::calculateResult in Voting API 8.3

Performs the calculations on a set of votes to derive the result.

Parameters

\Drupal\votingapi\Entity\Vote[] $votes: An array of Vote entities.

Return value

int A result based on the supplied votes.

4 methods override VoteResultFunctionInterface::calculateResult()
Average::calculateResult in src/Plugin/VoteResultFunction/Average.php
Performs the calculations on a set of votes to derive the result.
Count::calculateResult in src/Plugin/VoteResultFunction/Count.php
Performs the calculations on a set of votes to derive the result.
Sum::calculateResult in src/Plugin/VoteResultFunction/Sum.php
Performs the calculations on a set of votes to derive the result.
Zebra::calculateResult in tests/modules/votingapi_test/src/Plugin/VoteResultFunction/Zebra.php
Performs the calculations on a set of votes to derive the result.

File

src/VoteResultFunctionInterface.php, line 40

Class

VoteResultFunctionInterface
Provides an interface for a VoteResultFunction plugin.

Namespace

Drupal\votingapi

Code

public function calculateResult($votes);