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

44 lines
1.2 KiB
Markdown
Raw Normal View History

2022-09-21 12:39:11 +02:00
## public Vote::__construct
### 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.
##### **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```
---------------------------------------
### Related method(s)
* [Vote::setRanking](../Vote%20Class/public%20Vote--setRanking.md)
* [Vote::addTags](../Vote%20Class/public%20Vote--addTags.md)
---------------------------------------
### Examples and explanation
* **[Manual - Add Vote](https://github.com/julien-boudry/Condorcet/wiki/II-%23-B.-Vote-management-%23-1.-Add-Vote)**