You are here

public static function FacetsSummarySettingsForm::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/FacetsSummarySettingsForm.php, line 85

Class

FacetsSummarySettingsForm
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');

  /** @var \Drupal\Core\Block\BlockManager $block_manager */
  $block_manager = $container
    ->get('plugin.manager.block');

  /** @var \Drupal\Core\Routing\UrlGeneratorInterface $url_generator */
  $url_generator = $container
    ->get('url_generator');
  return new static($entity_type_manager, $facet_source_plugin_manager, $facet_manager, $processor_plugin_manager, $block_manager, $url_generator);
}