public function VotingApiWidgetBase::__construct in Votingapi Widgets 8
Constructs a new class instance.
Parameters
array $configuration: A configuration array containing information about the plugin instance.
string $plugin_id: The plugin_id for the plugin instance.
mixed $plugin_definition: The plugin implementation definition.
\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: Entity type manager service.
\Drupal\votingapi\VoteResultFunctionManager $vote_result: Vote result function manager service.
\Drupal\Core\Entity\EntityFormBuilderInterface $form_builder: The form builder service.
\Drupal\Core\Session\AccountInterface $account: The user account.
\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack.
\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory service.
Overrides PluginBase::__construct
File
- src/
Plugin/ VotingApiWidgetBase.php, line 87
Class
- VotingApiWidgetBase
- Base class for Voting api widget plugins.
Namespace
Drupal\votingapi_widgets\PluginCode
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, VoteResultFunctionManager $vote_result, EntityFormBuilderInterface $form_builder, AccountInterface $account, RequestStack $request_stack, ConfigFactoryInterface $config_factory) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->entityTypeManager = $entity_type_manager;
$this->votingapiResult = $vote_result;
$this->entityFormBuilder = $form_builder;
$this->account = $account;
$this->requestStack = $request_stack;
$this->configFactory = $config_factory;
}