You are here

public function LikeDislikeVoteBuilder::__construct in Like & Dislike 8

Constructs a new LikeDislikeVoteBuilder.

Parameters

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

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

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The configuration factory.

File

src/LikeDislikeVoteBuilder.php, line 57

Class

LikeDislikeVoteBuilder
Provides a lazy builder for user votes.

Namespace

Drupal\like_and_dislike

Code

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