You are here

public function VoteManager::__construct in Fivestar 8

Constructs a new VoteManager object.

Parameters

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

\Drupal\Core\Session\AccountProxyInterface $current_user: The current user.

File

src/VoteManager.php, line 43

Class

VoteManager
Contains methods for managing votes.

Namespace

Drupal\fivestar

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager, AccountProxyInterface $current_user) {
  $this->entityTypeManager = $entity_type_manager;
  $this->currentUser = $current_user;
  $this->voteStorage = $entity_type_manager
    ->getStorage('vote');
}