Skip to content

public Vote::__construct ​

Read it at the source

Description ​

php
public Vote->__construct ( array|string $ranking [, array|string|null $tags = null , ?float $ownTimestamp = null , ?CondorcetPHP\Condorcet\Election $electionContext = null] )

Build a vote object.

Parameters ​

ranking: array|string ​

Equivalent to Vote::setRanking method.

tags: array|string|null ​

Equivalent to Vote::addTags method.

ownTimestamp: ?float ​

Set your own timestamp metadata for this Ranking.

electionContext: ?CondorcetPHP\Condorcet\Election ​

Try to convert directly your candidates from string input to Candidate object of one election.

Throws: ​

  • CondorcetPHP\Condorcet\Throwable\VoteInvalidFormatException


Tutorial ​

Released under the MIT License.