You are here

HierarchyIsChildOfEntityRevision.php in Entity Reference Hierarchy 3.x

Same filename and directory in other branches
  1. 8.2 src/Plugin/views/argument/HierarchyIsChildOfEntityRevision.php

File

src/Plugin/views/argument/HierarchyIsChildOfEntityRevision.php
View source
<?php

namespace Drupal\entity_hierarchy\Plugin\views\argument;


/**
 * Argument to limit to children of a revision.
 *
 * @ingroup views_argument_handlers
 *
 * @ViewsArgument("entity_hierarchy_argument_is_child_of_entity_revision")
 */
class HierarchyIsChildOfEntityRevision extends HierarchyIsChildOfEntity {

  /**
   * {@inheritdoc}
   */
  protected function loadEntity() {
    $storage = $this->entityTypeManager
      ->getStorage($this
      ->getEntityType());
    return $storage
      ->loadRevision($this->argument) ?: $storage
      ->load($this->argument);
  }

}

Classes

Namesort descending Description
HierarchyIsChildOfEntityRevision Argument to limit to children of a revision.