You are here

public static function EntityAliasTypeDeriver::create in View Mode Page 4.0.x

Same name and namespace in other branches
  1. 8.3 src/Plugin/Derivative/EntityAliasTypeDeriver.php \Drupal\view_mode_page\Plugin\Derivative\EntityAliasTypeDeriver::create()
  2. 3.2.x src/Plugin/Derivative/EntityAliasTypeDeriver.php \Drupal\view_mode_page\Plugin\Derivative\EntityAliasTypeDeriver::create()

Creates a new class instance.

Parameters

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

string $base_plugin_id: The base plugin ID for the plugin ID.

Return value

static Returns an instance of this fetcher.

Overrides ContainerDeriverInterface::create

File

src/Plugin/Derivative/EntityAliasTypeDeriver.php, line 66

Class

EntityAliasTypeDeriver
Deriver that exposes content entities as alias type plugins.

Namespace

Drupal\view_mode_page\Plugin\Derivative

Code

public static function create(ContainerInterface $container, $base_plugin_id) {
  return new static($container
    ->get('entity_type.manager'), $container
    ->get('entity_field.manager'), $container
    ->get('string_translation'), $container
    ->get('token.entity_mapper'));
}