1.4 KiB
1.4 KiB
public Election::getWinner
Description
public Election->getWinner ( [?string $method = null] ): CondorcetPHP\Condorcet\Candidate|array|null
Get the natural Condorcet winner if there is one. Alternatively you can get the winner(s) from an advanced Condorcet algorithm.
method: ?string
*Only if not null: *
The winner will be provided by an advanced algorithm of an available advanced Condorcet method. For most of them, it will be the same as the Condorcet Marquis there. But if it does not exist, it may be different; and in some cases they may be multiple.
If null, Natural Condorcet algorithm will be use.
Return value:
(CondorcetPHP\Condorcet\Candidate|array|null
) Candidate object given. Null if there are no available winner or loser.
If you use an advanced method instead of Natural, you can get an array with multiples winners.
Throw an exception on error.