Function __global->cns_vote_in_poll
Definitions
sources/cns_polls_action2.php
- Place a vote on a specified poll.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $poll_id | AUTO_LINK | No | No | required parameter | N/A | N/A | The ID of the poll we're voting in |
| $votes | array | No | No | required parameter | N/A | N/A | A list of poll answers that are being voted for |
| $member_id | ?MEMBER | No | No | Null | N/A | N/A | The member that's voting (null: current member) |
| $topic_info | ?array | No | No | Null | N/A | N/A | The row of the topic the poll is for (null: get it from the DB) |
Preview
Code (PHP)
/**
* Place a vote on a specified poll.
*
* @param AUTO_LINK $poll_id The ID of the poll we're voting in
* @param array $votes A list of poll answers that are being voted for
* @param ?MEMBER $member_id The member that's voting (null: current member)
* @param ?array $topic_info The row of the topic the poll is for (null: get it from the DB)
*/
function cns_vote_in_poll(int $poll_id, array $votes, ?int $member_id = null, ?array $topic_info = null)
* Place a vote on a specified poll.
*
* @param AUTO_LINK $poll_id The ID of the poll we're voting in
* @param array $votes A list of poll answers that are being voted for
* @param ?MEMBER $member_id The member that's voting (null: current member)
* @param ?array $topic_info The row of the topic the poll is for (null: get it from the DB)
*/
function cns_vote_in_poll(int $poll_id, array $votes, ?int $member_id = null, ?array $topic_info = null)
