You are here

public function Count::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.

Overrides VoteResultFunctionInterface::calculateResult

File

src/Plugin/VoteResultFunction/Count.php, line 21

Class

Count
A sum of a set of votes.

Namespace

Drupal\votingapi\Plugin\VoteResultFunction

Code

public function calculateResult($votes) {
  return count($votes);
}