You are here

interface PollStorageInterface in Poll 8

Defines a common interface for poll entity controller classes.

Hierarchy

Expanded class hierarchy of PollStorageInterface

All classes that implement PollStorageInterface

File

src/PollStorageInterface.php, line 11

Namespace

Drupal\poll
View source
interface PollStorageInterface extends EntityStorageInterface {

  /**
   * Save a user's vote.
   *
   * @param array $options
   *
   * @return mixed
   *
   * @deprecated in Drupal 8.x-1.0.
   *   Use \Drupal\poll\PollVoteStorageInterface::saveVote() instead.
   *
   * @see \Drupal\poll\PollVoteStorageInterface::saveVote()
   */
  public function saveVote(array $options);

  /**
   * Cancel a user's vote.
   *
   * @param PollInterface $poll
   * @param AccountInterface $account
   *
   * @return mixed
   *
   * @deprecated in Drupal 8.x-1.0.
   *   Use \Drupal\poll\PollVoteStorageInterface::cancelVote() instead.
   *
   * @see \Drupal\poll\PollVoteStorageInterface::cancelVote()
   */
  public function cancelVote(PollInterface $poll, AccountInterface $account = NULL);

  /**
   * Get total votes for a poll.
   *
   * @param PollInterface $poll
   *
   * @return mixed
   *
   * @deprecated in Drupal 8.x-1.0.
   *   Use \Drupal\poll\PollVoteStorageInterface::getTotalVotes() instead.
   *
   * @see \Drupal\poll\PollVoteStorageInterface::getTotalVotes()
   */
  public function getTotalVotes(PollInterface $poll);

  /**
   * Get all votes for a poll.
   *
   * @param PollInterface $poll
   *
   * @return mixed
   *
   * @deprecated in Drupal 8.x-1.0.
   *   Use \Drupal\poll\PollVoteStorageInterface::getVotes() instead.
   *
   * @see \Drupal\poll\PollVoteStorageInterface::getVotes()
   */
  public function getVotes(PollInterface $poll);

  /**
   * Delete a user's votes for a poll.
   *
   * @param PollInterface $poll
   *
   * @return mixed
   *
   * @deprecated in Drupal 8.x-1.0.
   *   Use \Drupal\poll\PollVoteStorageInterface::deleteVotes() instead.
   *
   * @see \Drupal\poll\PollVoteStorageInterface::deleteVotes()
   */
  public function deleteVotes(PollInterface $poll);

  /**
   * Get a user's votes for a poll.
   *
   * @param PollInterface $poll
   *
   * @return mixed
   *
   * @deprecated in Drupal 8.x-1.0.
   *   Use \Drupal\poll\PollVoteStorageInterface::getUserVote() instead.
   *
   * @see \Drupal\poll\PollVoteStorageInterface::getUserVote()
   */
  public function getUserVote(PollInterface $poll);

  /**
   * Get the most recent poll posted on the site.
   *
   * @return mixed
   */
  public function getMostRecentPoll();

  /**
   * Find all duplicates of a poll by matching the question.
   *
   * @param PollInterface $poll
   *
   * @return mixed
   */
  public function getPollDuplicates(PollInterface $poll);

  /**
   * Returns all expired polls.
   *
   * @return \Drupal\poll\PollInterface[]
   *
   */
  public function getExpiredPolls();

}

Members

Namesort descending Modifiers Type Description Overrides
EntityStorageInterface::create public function Constructs a new entity object, without permanently saving it. 1
EntityStorageInterface::delete public function Deletes permanently saved entities. 1
EntityStorageInterface::deleteRevision public function Delete a specific entity revision. 4
EntityStorageInterface::FIELD_LOAD_CURRENT constant Load the most recent version of an entity's field data.
EntityStorageInterface::FIELD_LOAD_REVISION constant Load the version of an entity's field data specified in the entity.
EntityStorageInterface::getAggregateQuery public function Gets an aggregated query instance. 1
EntityStorageInterface::getEntityType public function Gets the entity type definition. 1
EntityStorageInterface::getEntityTypeId public function Gets the entity type ID. 1
EntityStorageInterface::getQuery public function Gets an entity query instance. 1
EntityStorageInterface::hasData public function Determines if the storage contains any data. 1
EntityStorageInterface::load public function Loads one entity. 1
EntityStorageInterface::loadByProperties public function Load entities by their property values. 1
EntityStorageInterface::loadMultiple public function Loads one or more entities. 1
EntityStorageInterface::loadRevision public function Load a specific entity revision. 4
EntityStorageInterface::loadUnchanged public function Loads an unchanged entity from the database. 1
EntityStorageInterface::resetCache public function Resets the internal, static entity cache. 1
EntityStorageInterface::restore public function Restores a previously saved entity. 1
EntityStorageInterface::save public function Saves the entity permanently. 1
PollStorageInterface::cancelVote Deprecated public function Cancel a user's vote. 1
PollStorageInterface::deleteVotes Deprecated public function Delete a user's votes for a poll. 1
PollStorageInterface::getExpiredPolls public function Returns all expired polls. 1
PollStorageInterface::getMostRecentPoll public function Get the most recent poll posted on the site. 1
PollStorageInterface::getPollDuplicates public function Find all duplicates of a poll by matching the question. 1
PollStorageInterface::getTotalVotes Deprecated public function Get total votes for a poll. 1
PollStorageInterface::getUserVote Deprecated public function Get a user's votes for a poll. 1
PollStorageInterface::getVotes Deprecated public function Get all votes for a poll. 1
PollStorageInterface::saveVote Deprecated public function Save a user's vote. 1