You are here

public static function EntityHooks::create in Entity Reference Hierarchy 3.x

Same name and namespace in other branches
  1. 8.2 modules/entity_hierarchy_microsite/src/EntityHooks.php \Drupal\entity_hierarchy_microsite\EntityHooks::create()

Instantiates a new instance of this class.

This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton.

Parameters

\Symfony\Component\DependencyInjection\ContainerInterface $container: The service container this instance should use.

Overrides ContainerInjectionInterface::create

File

modules/entity_hierarchy_microsite/src/EntityHooks.php, line 87

Class

EntityHooks
Defines a class for entity hooks for the module.

Namespace

Drupal\entity_hierarchy_microsite

Code

public static function create(ContainerInterface $container) {
  return new static($container
    ->get('plugin.manager.menu.link'), $container
    ->get('entity_hierarchy.information.parent_candidate'), $container
    ->get('entity_hierarchy_microsite.microsite_lookup'), $container
    ->get('entity_hierarchy_microsite.menu_link_discovery'), $container
    ->get('menu.link_tree'));
}