\Poll
This represents a poll data object that should have 2 more {@link PollChoice}s
Synopsis
class Poll
extends DataObject
implements
PermissionProvider
{
- // constants
- const COOKIE_PREFIX = 'SSPoll_';
- // members
- public static array $db = ;
- public static array $has_one = ;
- public static array $has_many = ;
- public static array $searchable_fields = ;
- public static array $summary_fields = ;
- public static string $default_sort = 'Created DESC';
- private static string $vote_handler_class = 'CookieVoteHandler';
- public $voteHandler;
- // methods
- public void __construct()
- public void getCMSFields()
- public void getTotalVotes()
- public void getMaxVotes()
- public void markAsVoted()
- public bool hasVoted()
- public void isVoted()
- public void getVisible()
- public void providePermissions()
- public void canCreate()
- public void canEdit()
- public void canDelete()
- public void canVote()
Hierarchy
Extends
- DataObject
Implements
- PermissionProvider
Constants
Name | Value |
---|---|
COOKIE_PREFIX | 'SSPoll_' |
Members
private
- $vote_handler_class
public
- $db
- $default_sort
- $has_many
- $has_one
- $searchable_fields
- $summary_fields
- $voteHandler
Methods
public
- __construct()
- canCreate()
- canDelete()
- canEdit()
- canVote()
- getCMSFields()
- getMaxVotes()
- getTotalVotes()
- getVisible() — Check if poll should be visible, taking into account the IsActive and embargo/expiry
- hasVoted() — Check if the user, determined by browser cookie, has been submitted a vote to the poll.
- isVoted()
- markAsVoted() — Mark the the poll has been voted by the user, which determined by browser cookie
- providePermissions()