You are here

public static function EntityHierarchy::create in Entity Reference Hierarchy 8.2

Same name in this branch
  1. 8.2 src/Plugin/EntityReferenceSelection/EntityHierarchy.php \Drupal\entity_hierarchy\Plugin\EntityReferenceSelection\EntityHierarchy::create()
  2. 8.2 modules/entity_hierarchy_workbench_access/src/Plugin/AccessControlHierarchy/EntityHierarchy.php \Drupal\entity_hierarchy_workbench_access\Plugin\AccessControlHierarchy\EntityHierarchy::create()
Same name and namespace in other branches
  1. 3.x modules/entity_hierarchy_workbench_access/src/Plugin/AccessControlHierarchy/EntityHierarchy.php \Drupal\entity_hierarchy_workbench_access\Plugin\AccessControlHierarchy\EntityHierarchy::create()

Creates an instance of the plugin.

Parameters

\Symfony\Component\DependencyInjection\ContainerInterface $container: The container to pull out services used in the plugin.

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.

Return value

static Returns an instance of this plugin.

Overrides AccessControlHierarchyBase::create

File

modules/entity_hierarchy_workbench_access/src/Plugin/AccessControlHierarchy/EntityHierarchy.php, line 105

Class

EntityHierarchy
Defines a hierarchy based on an entity hierarchy field.

Namespace

Drupal\entity_hierarchy_workbench_access\Plugin\AccessControlHierarchy

Code

public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
  return new static($configuration, $plugin_id, $plugin_definition, $container
    ->get('workbench_access.user_section_storage'), $container
    ->get('entity_field.manager'), $container
    ->get('entity_hierarchy.nested_set_storage_factory'), $container
    ->get('entity_hierarchy.nested_set_node_factory'), $container
    ->get('entity_type.manager'), $container
    ->get('config.factory'), $container
    ->get('entity_hierarchy.entity_tree_node_mapper'), $container
    ->get('cache.entity_hierarchy_workbench_access'));
}