protected function HierarchyIsChildOfEntityRevision::loadEntity in Entity Reference Hierarchy 8.2
Same name and namespace in other branches
- 3.x src/Plugin/views/argument/HierarchyIsChildOfEntityRevision.php \Drupal\entity_hierarchy\Plugin\views\argument\HierarchyIsChildOfEntityRevision::loadEntity()
Loads the parent entity from the argument.
Return value
\Drupal\Core\Entity\EntityInterface Parent entity if exists.
Overrides EntityHierarchyArgumentPluginBase::loadEntity
File
- src/
Plugin/ views/ argument/ HierarchyIsChildOfEntityRevision.php, line 17
Class
- HierarchyIsChildOfEntityRevision
- Argument to limit to children of a revision.
Namespace
Drupal\entity_hierarchy\Plugin\views\argumentCode
protected function loadEntity() {
$storage = $this->entityTypeManager
->getStorage($this
->getEntityType());
return $storage
->loadRevision($this->argument) ?: $storage
->load($this->argument);
}