public function NotConditionPluginBase::__construct in Block Visibility Conditions 8
Creates a new NotNodeType instance.
Parameters
array $configuration: The plugin configuration, i.e. an array with configuration values keyed by configuration option name. The special key 'context' may be used to initialize the defined contexts by setting it to an array of context values keyed by context names.
string $plugin_id: The plugin_id for the plugin instance.
mixed $plugin_definition: The plugin implementation definition.
EntityTypeManagerInterface $entity_type_manager: The entity type manager.
CurrentRouteMatch $route_match: The route match.
Throws
\Drupal\Component\Plugin\Exception\PluginNotFoundException
Overrides ConditionPluginBase::__construct
File
- src/
Plugin/ Condition/ NotConditionPluginBase.php, line 70
Class
- NotConditionPluginBase
- Provides a 'Not {ContentEntityType}'-base condition.
Namespace
Drupal\block_visibility_conditions\Plugin\ConditionCode
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, CurrentRouteMatch $route_match) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->entityTypeManager = $entity_type_manager;
$this->routeMatch = $route_match;
/** @var \Drupal\Core\Config\Entity\ConfigEntityType $contentEntityType */
$this->contentEntityType = $this->entityTypeManager
->getDefinition(static::CONTENT_ENTITY_TYPE);
$this->bundle = $this->entityTypeManager
->getDefinition($this->contentEntityType
->getBundleOf());
}