openquestions-1.0.x-dev/src/Event/OQVoteEvent.php
src/Event/OQVoteEvent.php
<?php
namespace Drupal\openquestions\Event;
use Drupal\Component\EventDispatcher\Event;
use Drupal\openquestions\Entity\OqVote;
/**
* Event that contains a vote.
*/
class OQVoteEvent extends Event {
const EVENT = 'openquestions.oq_vote_event';
/**
* The vote involved in this event.
*
* @var \Drupal\openquestions\Entity\OqVote
*/
protected $oqVote;
/**
* Construct with the vote.
*
* @param \Drupal\openquestions\Entity\OqVote $oqVote
* The vote.
*/
public function __construct(OqVote $oqVote) {
$this->oqVote = $oqVote;
}
/**
* Returns the vote involved in this event.
*
* @return \Drupal\openquestions\Entity\OqVote
* The vote.
*/
public function getVote() {
return $this->oqVote;
}
}
