protected function PanelizerFieldPanelsStorage::getEntityContext in Panelizer 8.4
Same name and namespace in other branches
- 8.5 src/Plugin/PanelsStorage/PanelizerFieldPanelsStorage.php \Drupal\panelizer\Plugin\PanelsStorage\PanelizerFieldPanelsStorage::getEntityContext()
- 8.3 src/Plugin/PanelsStorage/PanelizerFieldPanelsStorage.php \Drupal\panelizer\Plugin\PanelsStorage\PanelizerFieldPanelsStorage::getEntityContext()
Returns the entity context.
Wraps creating new Context objects to avoid typed data in tests.
Parameters
string $entity_type_id: The entity type id.
\Drupal\Core\Entity\EntityInterface $entity: The entity.
Return value
\Drupal\Core\Plugin\Context\Context The context.
1 call to PanelizerFieldPanelsStorage::getEntityContext()
- PanelizerFieldPanelsStorage::load in src/
Plugin/ PanelsStorage/ PanelizerFieldPanelsStorage.php
File
- src/
Plugin/ PanelsStorage/ PanelizerFieldPanelsStorage.php, line 104
Class
- PanelizerFieldPanelsStorage
- Panels storage service that stores Panels displays in the Panelizer field.
Namespace
Drupal\panelizer\Plugin\PanelsStorageCode
protected function getEntityContext($entity_type_id, EntityInterface $entity) {
return new AutomaticContext(EntityContextDefinition::fromEntityTypeId($entity_type_id), $entity);
}