You are here

public static function FacetBlockDeriver::create in Facets 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/Plugin/Block/FacetBlockDeriver.php, line 34

Class

FacetBlockDeriver
This deriver creates a block for every facet that has been created.

Namespace

Drupal\facets\Plugin\Block

Code

public static function create(ContainerInterface $container, $base_plugin_id) {
  $deriver = new static($container, $base_plugin_id);
  $deriver->facetStorage = $container
    ->get('entity_type.manager')
    ->getStorage('facets_facet');
  return $deriver;
}