\CookieVoteHandler
Default vote handler.
If a user votes for a poll and Cookie is stored on their computer which assigns
that they have voted for a particular poll ID
Synopsis
class CookieVoteHandler
extends Vote_Backend
{
- // constants
- const COOKIE_PREFIX = 'SSPoll_';
- // Inherited members from Vote_Backend
- protected $poll;
- // methods
- public void markAsVoted()
- public bool canVote()
- public bool hasVoted()
- // Inherited methods from Vote_Backend
- public void __construct()
- public abstract void hasVoted()
- public abstract void canVote()
- public abstract void markAsVoted()
- public void setPoll()
- public void getPoll()
Hierarchy
Extends
Constants
Name | Value |
---|---|
COOKIE_PREFIX | 'SSPoll_' |
Members
protected
- $poll
Methods
public
- canVote() — Checks to see if the user can vote. Verified by checking whether or not the user has voted before. Which is the only limitation of this cookie based implementation.
- hasVoted() — Checks to see if the user has a cookie set which is generated when they vote on a poll
- markAsVoted() — Generates a cookie to indicate the user has voted on the poll.