Function __global->cns_may_attach_poll
Definitions
sources/cns_polls.php
- Find whether a member may attach a poll to a detailed topic.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: bool
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $topic_id | AUTO_LINK | No | No | required parameter | N/A | N/A | The topic |
| $topic_owner | ?MEMBER | No | No | Null | N/A | N/A | The topic owner (null: ask the DB for it) |
| $has_poll_already | ?boolean | No | No | Null | N/A | N/A | Whether the topic already has a poll (null: ask the DB for it) |
| $forum_id | ?MEMBER | No | No | Null | N/A | N/A | The forum the topic is in (null: ask the DB for it) |
| $member_id | ?MEMBER | No | No | Null | N/A | N/A | The member we are checking for (null: current member) |
Returns
- The answer
- Type: boolean
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Find whether a member may attach a poll to a detailed topic.
*
* @param AUTO_LINK $topic_id The topic
* @param ?MEMBER $topic_owner The topic owner (null: ask the DB for it)
* @param ?boolean $has_poll_already Whether the topic already has a poll (null: ask the DB for it)
* @param ?MEMBER $forum_id The forum the topic is in (null: ask the DB for it)
* @param ?MEMBER $member_id The member we are checking for (null: current member)
* @return boolean The answer
*/
function cns_may_attach_poll(int $topic_id, ?int $topic_owner = null, ?bool $has_poll_already = null, ?int $forum_id = null, ?int $member_id = null) : bool
* Find whether a member may attach a poll to a detailed topic.
*
* @param AUTO_LINK $topic_id The topic
* @param ?MEMBER $topic_owner The topic owner (null: ask the DB for it)
* @param ?boolean $has_poll_already Whether the topic already has a poll (null: ask the DB for it)
* @param ?MEMBER $forum_id The forum the topic is in (null: ask the DB for it)
* @param ?MEMBER $member_id The member we are checking for (null: current member)
* @return boolean The answer
*/
function cns_may_attach_poll(int $topic_id, ?int $topic_owner = null, ?bool $has_poll_already = null, ?int $forum_id = null, ?int $member_id = null) : bool
