function Type::create

Same name and namespace in other branches
  1. 9 core/modules/node/src/Plugin/views/argument/Type.php \Drupal\node\Plugin\views\argument\Type::create()
  2. 8.9.x core/modules/node/src/Plugin/views/argument/Type.php \Drupal\node\Plugin\views\argument\Type::create()
  3. 11.x core/modules/node/src/Plugin/views/argument/Type.php \Drupal\node\Plugin\views\argument\Type::create()

Overrides PluginBase::create

File

core/modules/node/src/Plugin/views/argument/Type.php, line 44

Class

Type
Argument handler to accept a node type.

Namespace

Drupal\node\Plugin\views\argument

Code

public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    $entity_type_manager = $container->get('entity_type.manager');
    return new static($configuration, $plugin_id, $plugin_definition, $entity_type_manager->getStorage('node_type'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.