You are here

interface PollVoteStorageInterface in Poll 8

Defines a common interface for poll vote controller classes.

Hierarchy

Expanded class hierarchy of PollVoteStorageInterface

All classes that implement PollVoteStorageInterface

File

src/PollVoteStorageInterface.php, line 10

Namespace

Drupal\poll
View source
interface PollVoteStorageInterface {

  /**
   * Delete a user's votes for a poll choice.
   *
   * @param array $choices
   *   A list of choice ID's for each one we will remove all the votes.
   */
  public function deleteChoicesVotes(array $choices);

  /**
   * Delete a user's votes for a poll.
   *
   * @param PollInterface $poll
   *
   * @return mixed
   */
  public function deleteVotes(PollInterface $poll);

  /**
   * Cancel a user's vote.
   *
   * @param PollInterface $poll
   * @param AccountInterface $account
   */
  public function cancelVote(PollInterface $poll, AccountInterface $account = NULL);

  /**
   * Save a user's vote.
   *
   * @param array $options
   */
  public function saveVote(array $options);

  /**
   * Get all votes for a poll.
   *
   * @param PollInterface $poll
   *
   * @return mixed
   */
  public function getVotes(PollInterface $poll);

  /**
   * Get a user's votes for a poll.
   *
   * @param PollInterface $poll
   *
   * @return mixed
   */
  public function getUserVote(PollInterface $poll);

  /**
   * Get total votes for a poll.
   *
   * @param PollInterface $poll
   *
   * @return mixed
   */
  public function getTotalVotes(PollInterface $poll);

}

Members

Namesort descending Modifiers Type Description Overrides
PollVoteStorageInterface::cancelVote public function Cancel a user's vote. 1
PollVoteStorageInterface::deleteChoicesVotes public function Delete a user's votes for a poll choice. 1
PollVoteStorageInterface::deleteVotes public function Delete a user's votes for a poll. 1
PollVoteStorageInterface::getTotalVotes public function Get total votes for a poll. 1
PollVoteStorageInterface::getUserVote public function Get a user's votes for a poll. 1
PollVoteStorageInterface::getVotes public function Get all votes for a poll. 1
PollVoteStorageInterface::saveVote public function Save a user's vote. 1