public static function SearchApiSortsBlockDeriver::create in Search API sorts 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/ SearchApiSortsBlockDeriver.php, line 34
Class
- SearchApiSortsBlockDeriver
- This deriver creates a block for every index that has been created.
Namespace
Drupal\search_api_sorts\Plugin\BlockCode
public static function create(ContainerInterface $container, $base_plugin_id) {
$deriver = new static($container, $base_plugin_id);
$deriver->indexStorage = $container
->get('entity_type.manager')
->getStorage('search_api_index');
return $deriver;
}