Function __global->cns_poll_get_results
Definitions
sources/cns_polls.php
- Find a map of results relating to a certain poll.Applies forfeiting if required.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: array
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $poll_id | AUTO_LINK | No | No | required parameter | N/A | N/A | The poll |
| $request_results | boolean | No | No | True | N/A | N/A | Whether we must record that the current member is requesting the results, blocking future voting for them |
| $request_voters | ?array | No | No | Null | N/A | N/A | An array of [int $start = 0, string $order_by = 'pv_date_time DESC', int $max = 50] if we want to also return specific member IDs and what they voted (null: Do not include specific votes) |
| $answer_id | ?AUTO_LINK | No | No | Null | N/A | N/A | The poll answer ID to filter by (null: return all answers) |
Returns
- The map of results (null: could not find poll)
- Type: ?array
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Find a map of results relating to a certain poll.Applies forfeiting if required.
*
* @param AUTO_LINK $poll_id The poll
* @param boolean $request_results Whether we must record that the current member is requesting the results, blocking future voting for them
* @param ?array $request_voters An array of [int $start = 0, string $order_by = 'pv_date_time DESC', int $max = 50] if we want to also return specific member IDs and what they voted (null: Do not include specific votes)
* @param ?AUTO_LINK $answer_id The poll answer ID to filter by (null: return all answers)
* @return ?array The map of results (null: could not find poll)
*/
function cns_poll_get_results(int $poll_id, bool $request_results = true, ?array $request_voters = null, ?int $answer_id = null) : ?array
* Find a map of results relating to a certain poll.Applies forfeiting if required.
*
* @param AUTO_LINK $poll_id The poll
* @param boolean $request_results Whether we must record that the current member is requesting the results, blocking future voting for them
* @param ?array $request_voters An array of [int $start = 0, string $order_by = 'pv_date_time DESC', int $max = 50] if we want to also return specific member IDs and what they voted (null: Do not include specific votes)
* @param ?AUTO_LINK $answer_id The poll answer ID to filter by (null: return all answers)
* @return ?array The map of results (null: could not find poll)
*/
function cns_poll_get_results(int $poll_id, bool $request_results = true, ?array $request_voters = null, ?int $answer_id = null) : ?array
