Function __global->cns_calculate_poll_voting_power
Definitions
sources/cns_polls_action2.php
- Calculate how much voting power a particular poll has in total, and cache it (this also does the same for all answers and votes).
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: float
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 ID |
| $recalculate | boolean | No | No | False | N/A | N/A | Recalculate even if a cached voting power already exists |
| $row | ?array | No | No | Null | N/A | N/A | The database row for the poll if it was already queried elsewhere (null: query for it) |
Returns
- The total voting power for the specified poll
- Type: float
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Calculate how much voting power a particular poll has in total, and cache it (this also does the same for all answers and votes).
*
* @param AUTO_LINK $poll_id The poll ID
* @param boolean $recalculate Recalculate even if a cached voting power already exists
* @param ?array $row The database row for the poll if it was already queried elsewhere (null: query for it)
* @return float The total voting power for the specified poll
*/
function cns_calculate_poll_voting_power(int $poll_id, bool $recalculate = false, ?array $row = null) : float
* Calculate how much voting power a particular poll has in total, and cache it (this also does the same for all answers and votes).
*
* @param AUTO_LINK $poll_id The poll ID
* @param boolean $recalculate Recalculate even if a cached voting power already exists
* @param ?array $row The database row for the poll if it was already queried elsewhere (null: query for it)
* @return float The total voting power for the specified poll
*/
function cns_calculate_poll_voting_power(int $poll_id, bool $recalculate = false, ?array $row = null) : float

