You are here

public function FieldCount::calculateResult in Votingapi Widgets 8

Calculate results.

Overrides FieldVoteResultBase::calculateResult

File

src/Plugin/VoteResultFunction/FieldCount.php, line 22

Class

FieldCount
A sum of a set of votes.

Namespace

Drupal\votingapi_widgets\Plugin\VoteResultFunction

Code

public function calculateResult($votes) {
  $votes = $this
    ->getVotesForField($votes);
  return count($votes);
}