You are here

public static function DisplayDeriverBase::create in Search API 8

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/Display/DisplayDeriverBase.php, line 33

Class

DisplayDeriverBase
A base class for display derivers.

Namespace

Drupal\search_api\Display

Code

public static function create(ContainerInterface $container, $base_plugin_id) {
  $deriver = new static();
  $entity_type_manager = $container
    ->get('entity_type.manager');
  $deriver
    ->setEntityTypeManager($entity_type_manager);
  $translation = $container
    ->get('string_translation');
  $deriver
    ->setStringTranslation($translation);
  return $deriver;
}