1
0
This repository has been archived on 2023-11-30. You can view files and clone it, but cannot push or open issues or pull requests.
dtux__serveur-vote-lalis/include/condorcet/Documentation/Vote Class/public Vote--__construct.md
2022-09-21 14:01:45 +02:00

1.2 KiB

public Vote::__construct

Description

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

Build a vote object.

ranking: array|string

Equivalent to Vote::setRanking method.

tags: array|string|null

Equivalent to Vote::addTags method.

ownTimestamp: ?float

Set your own timestamp metadata on Ranking.

electionContext: ?CondorcetPHP\Condorcet\Election

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

Throws:

  • CondorcetPHP\Condorcet\Throwable\VoteInvalidFormatException


Examples and explanation