openquestions-1.0.x-dev/src/Model/VoteDataInterface.php
src/Model/VoteDataInterface.php
<?php
namespace Drupal\openquestions\Model;
/**
* Interface representing the votes on an item.
*
* Java way is prefered: https://www.drupal.org/project/coder/issues/2463633
*/
interface VoteDataInterface {
/**
* Returns an array of users that are allowed to vote system-wide.
*/
public function getAllAccountsThatAreAllowedToVote() : array;
/**
* Returns an array of users that are allowed to vote, but just on this item.
*/
public function getAccountsThatAreAllowedToVoteOnThisItem() : array;
/**
* Returns an array of users that hava voted on this item.
*/
public function getAccountsThatHaveVoted() : array;
/**
* Returns an array of the votes for the given question.
*
* Each element is an array that will usually have just 1 item, but might have
* more if the user voted, canceled their vote, and then voted again.
*/
public function getVotesForQuestionId($questionID);
/**
* Returns an array of the votes for the given question and user.
*
* The returned array will usually have just 1 item, but might have
* more if the user voted, canceled their vote, and then voted again.
*/
public function getVotesForQuestionIdAndAccountId($questionID, $uid);
}
