You are here

public static function FacetsSummaryForm::create in Facets 8

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 FormBase::create

File

modules/facets_summary/src/Form/FacetsSummaryForm.php, line 79

Class

FacetsSummaryForm
Provides a form for configuring the processors of a facet.

Namespace

Drupal\facets_summary\Form

Code

public static function create(ContainerInterface $container) {

  /** @var \Drupal\Core\Entity\EntityTypeManager $entity_type_manager */
  $entity_type_manager = $container
    ->get('entity_type.manager');

  /** @var \Drupal\facets\FacetSource\FacetSourcePluginManager $facet_source_plugin_manager */
  $facet_source_plugin_manager = $container
    ->get('plugin.manager.facets.facet_source');

  /** @var \Drupal\facets\FacetManager\DefaultFacetManager $facet_manager */
  $facet_manager = $container
    ->get('facets.manager');

  /** @var \Drupal\facets_summary\Processor\ProcessorPluginManager $processor_plugin_manager */
  $processor_plugin_manager = $container
    ->get('plugin.manager.facets_summary.processor');
  return new static($entity_type_manager, $facet_source_plugin_manager, $facet_manager, $processor_plugin_manager);
}