Function __global->vote_in_poll

Definitions

sources/polls.php

  • Vote in a poll.
  • 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 ID
$cast ?integer No No required parameter N/A N/A Vote to cast (null: forfeit vote)
$myrow ?array No No Null N/A N/A Poll row (null: lookup from DB)
$member_id ?MEMBER No No Null N/A N/A Who to vote (null: current user)
$ip ?IP No No Null N/A N/A The IP to vote (null: no IP check)

Returns

  • Amended poll row
  • Type: array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Vote in a poll.
 *
 * @param  AUTO_LINK $poll_id The poll ID
 * @param  ?integer $cast Vote to cast (null: forfeit vote)
 * @param  ?array $myrow Poll row (null: lookup from DB)
 * @param  ?MEMBER $member_id Who to vote (null: current user)
 * @param  ?IP $ip The IP to vote (null: no IP check)
 * @return array Amended poll row
 */

function vote_in_poll(int $poll_id, ?int $cast, ?array $myrow = null, ?int $member_id = null, ?string $ip = null) : array