コード例 #1
0
 /**
  * Constructs a new RegisterIdentityContactSelection object.
  *
  * {@inheritdoc}
  *
  * @param \Drupal\rng\EventManagerInterface $event_manager
  *   The RNG event manager.
  * @param \Drupal\Core\Condition\ConditionManager $condition_manager
  *   The condition plugin manager.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManagerInterface $entity_manager, ModuleHandlerInterface $module_handler, AccountInterface $current_user, Connection $connection, EventManagerInterface $event_manager, ConditionManager $condition_manager)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition, $entity_manager, $module_handler, $current_user, $connection);
     if (isset($this->configuration['handler_settings']['event_entity_type'], $this->configuration['handler_settings']['event_entity_id'])) {
         $event = $this->entityManager->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->entityManager->getDefinition($this->configuration['target_type']);
 }
コード例 #2
0
ファイル: UserSelection.php プロジェクト: nstielau/drops-8
 /**
  * Constructs a new UserSelection object.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
  *   The entity manager service.
  * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
  *   The module handler service.
  * @param \Drupal\Core\Session\AccountInterface $current_user
  *   The current user.
  * @param \Drupal\Core\Database\Connection $connection
  *   The database connection.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManagerInterface $entity_manager, ModuleHandlerInterface $module_handler, AccountInterface $current_user, Connection $connection)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition, $entity_manager, $module_handler, $current_user);
     $this->connection = $connection;
     $this->userStorage = $entity_manager->getStorage('user');
 }