public function RNGSelectionBase::__construct in RNG - Events and Registrations 3.x
Same name and namespace in other branches
- 8.2 src/Plugin/EntityReferenceSelection/RNGSelectionBase.php \Drupal\rng\Plugin\EntityReferenceSelection\RNGSelectionBase::__construct()
- 8 src/Plugin/EntityReferenceSelection/RNGSelectionBase.php \Drupal\rng\Plugin\EntityReferenceSelection\RNGSelectionBase::__construct()
Constructs a new RegisterIdentityContactSelection object.
Parameters
\Drupal\rng\EventManagerInterface $event_manager: The RNG event manager.
\Drupal\Core\Condition\ConditionManager $condition_manager: The condition plugin manager.
Overrides DefaultSelection::__construct
File
- src/
Plugin/ EntityReferenceSelection/ RNGSelectionBase.php, line 50
Class
- RNGSelectionBase
- Base RNG selection plugin.
Namespace
Drupal\rng\Plugin\EntityReferenceSelectionCode
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, ModuleHandlerInterface $module_handler, AccountInterface $current_user, EntityFieldManagerInterface $entity_field_manager, EntityTypeBundleInfoInterface $entity_type_bundle_info, EntityRepositoryInterface $entity_repository, EventManagerInterface $event_manager, ConditionManager $condition_manager) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $entity_type_manager, $module_handler, $current_user, $entity_field_manager, $entity_type_bundle_info, $entity_repository);
if (isset($this->configuration['handler_settings']['event_entity_type'], $this->configuration['handler_settings']['event_entity_id'])) {
$event = $this->entityTypeManager
->getStorage($this->configuration['handler_settings']['event_entity_type'])
->load($this->configuration['handler_settings']['event_entity_id']);
$this->eventMeta = $event_manager
->getMeta($event);
}
else {
throw new \Exception('RNG selection handler requires event context.');
}
$this->conditionManager = $condition_manager;
$this->entityType = $this->entityTypeManager
->getDefinition($this->configuration['target_type']);
}