public static function FieldBlock::create in Field as Block 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/ Derivative/ FieldBlock.php, line 49 - Contains \Drupal\fieldblock\Plugin\Derivative\FieldBlock.
Class
- FieldBlock
- Provides block plugin definitions for fieldblock blocks.
Namespace
Drupal\fieldblock\Plugin\DerivativeCode
public static function create(ContainerInterface $container, $base_plugin_id) {
/** @var EntityManagerInterface $entity_manager */
$entity_manager = $container
->get('entity.manager');
return new static($entity_manager
->getStorage('entity_view_display'), $container
->get('string_translation'));
}