You are here

protected function PanelizerEntityViewBuilder::getEntityContext in Panelizer 8.3

Same name and namespace in other branches
  1. 8.5 src/PanelizerEntityViewBuilder.php \Drupal\panelizer\PanelizerEntityViewBuilder::getEntityContext()
  2. 8.4 src/PanelizerEntityViewBuilder.php \Drupal\panelizer\PanelizerEntityViewBuilder::getEntityContext()

Returns the entity context.

Wraps creating new Context objects to avoid typed data in tests.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity.

Return value

\Drupal\Core\Plugin\Context\Context The context.

1 call to PanelizerEntityViewBuilder::getEntityContext()
PanelizerEntityViewBuilder::buildPanelized in src/PanelizerEntityViewBuilder.php
Build the render array for a single panelized entity.

File

src/PanelizerEntityViewBuilder.php, line 212

Class

PanelizerEntityViewBuilder
Entity view builder for entities that can be panelized.

Namespace

Drupal\panelizer

Code

protected function getEntityContext(EntityInterface $entity) {
  return new Context(new ContextDefinition('entity:' . $this->entityTypeId, NULL, TRUE), $entity);
}