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/Election Class/public Election--parseCandidates.md

44 lines
1.2 KiB
Markdown

## public Election::parseCandidates
### Description
```php
public Election->parseCandidates ( string $input [, bool $isFile = false] ): array
```
Import candidate from a text source.
##### **input:** *```string```*
String or valid path to a text file.
##### **isFile:** *```bool```*
If true, the input is evaluated as path to a text file.
### Return value:
*(```array```)* List of newly registered candidate object. Count it for checking if all candidates have been correctly registered.
### Throws:
* ```CondorcetPHP\Condorcet\Throwable\CandidateExistsException```
* ```CondorcetPHP\Condorcet\Throwable\VoteMaxNumberReachedException```
---------------------------------------
### Related method(s)
* [Election::addCandidate](../Election%20Class/public%20Election--addCandidate.md)
* [Election::addCandidatesFromJson](../Election%20Class/public%20Election--addCandidatesFromJson.md)
* [Election::parseVotes](../Election%20Class/public%20Election--parseVotes.md)
---------------------------------------
### Examples and explanation
* **[Manual - Manage Candidates](https://github.com/julien-boudry/Condorcet/wiki/II-%23-A.-Create-an-Election-%23-2.-Create-Candidates)**