protected function HierarchyIsParentOfEntityRevision::loadEntity in Entity Reference Hierarchy 8.2
Same name and namespace in other branches
- 3.x src/Plugin/views/argument/HierarchyIsParentOfEntityRevision.php \Drupal\entity_hierarchy\Plugin\views\argument\HierarchyIsParentOfEntityRevision::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/ HierarchyIsParentOfEntityRevision.php, line 17
Class
- HierarchyIsParentOfEntityRevision
- Argument to limit to parent 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);
}