You are here

protected function PanelizerFieldPanelsStorage::getEntityContext in Panelizer 8.5

Same name and namespace in other branches
  1. 8.3 src/Plugin/PanelsStorage/PanelizerFieldPanelsStorage.php \Drupal\panelizer\Plugin\PanelsStorage\PanelizerFieldPanelsStorage::getEntityContext()
  2. 8.4 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\PanelsStorage

Code

protected function getEntityContext($entity_type_id, EntityInterface $entity) {
  return new AutomaticContext(new EntityContextDefinition('entity:' . $entity_type_id, NULL, TRUE), $entity);
}