public function PanelizerEntityDefault::get_entity_view_entity in Panelizer 7.3
Fetch the entity out of a build for hook_entity_view.
Parameters
$build: The render array that contains the entity.
Overrides PanelizerEntityInterface::get_entity_view_entity
2 methods override PanelizerEntityDefault::get_entity_view_entity()
- PanelizerEntityTaxonomyTerm::get_entity_view_entity in plugins/
entity/ PanelizerEntityTaxonomyTerm.class.php - Fetch the entity out of a build for hook_entity_view.
- PanelizerEntityUser::get_entity_view_entity in plugins/
entity/ PanelizerEntityUser.class.php - Fetch the entity out of a build for hook_entity_view.
File
- plugins/
entity/ PanelizerEntityDefault.class.php, line 3602 - Base class for the Panelizer Entity plugin.
Class
- PanelizerEntityDefault
- Base class for the Panelizer Entity plugin.
Code
public function get_entity_view_entity($build) {
$element = '#' . $this->entity_type;
if (isset($build[$element])) {
return $build[$element];
}
else {
if (isset($build['#entity'])) {
return $build['#entity'];
}
}
}