Returns the $revision of the entity with the $parentIdentifier

notice that the returned Entity may not have the same identifier as $parentIdentifier
@return Entity
519007
protected function hydrateEntityInRevision($parentIdentifier, $revision) {
    $parentIdentifier = $this->v->validateIdentifier($parentIdentifier, $this->getEntityMeta());
    
    if ($revision === $this->defaultRevision) {
      return $this->repository->hydrate($parentIdentifier);
    } else {
      throw EntityNotFoundException::criteria(compact('parentIdentifier', 'revision'));
    }
  }
1136104
public function getIdentifier()
    {
        $this->preGetIdentifier();
        $result = $this->dataStore->getIdentifier();

        return $this->postGetIdentifier($result);
    }
408238
public function getEntityRepository()
    {
        $repository = $this->entityManager->getRepository($this->getEntityName());

        if (!($repository instanceof EntityRepository)) {
            throw new InvalidEntityNameException($this->getEntityName(), $this->getEntityClass());
        }

        return $repository;
    }
1122683
public function create($identifiers = null)
    {
        $parents = func_get_args();

        if ($this->failsSecurity()) {
            return $this->responseDenied();
        }

        if ($this->failsParentMatch($parents)) {
            return $this->responseNotFound();
        }

        $input = $this->getInput();

        if ($this->failsValidation($input)) {
            return $this->responseBadInput();
        }

        $entity = $parents ? $this->resource->createWithParent(end($parents), $input) : $this->resource->create($input);

        return $this->response($entity, 201);
    }
1318967
public function parent()
    {
        $p = $this->_parent();
        return $p ? new self($this->doc, $p) : null;
    }
970153
function get_parent(){
		if( !is_null($this->pidx) && isset(self::$reg[$this->pidx]) ){
			return self::$reg[$this->pidx];
		}
		else {
			return null;
		}
	}
1120881
private function getRelatedEntityIdentifier($entity)
    {
        \assert('is_object($entity)');

        if ($entity instanceof \Doctrine\Common\Persistence\Proxy) {
            $entity->__load();
        }

        $relClass = \get_class($entity);

        $ManagerForClass = $this->registry->getManagerForClass($relClass);

        if (!$ManagerForClass) {
            throw new \InvalidArgumentException(sprintf('The getManagerForClass for entity of class "%s" was empty.', $relClass));
        }

        $relId = $ManagerForClass->getMetadataFactory()
            ->getMetadataFor($relClass)->getIdentifierValues($entity);

        asort($relId);

        if (!$relId) {
            throw new \InvalidArgumentException(sprintf('The identifier for entity of class "%s" was empty.', $relClass));
        }

        return [$relClass, json_encode($relId)];
    }
224277
public function getDefaultParent()
    {
        if ($defaultParents = $this->config()->default_parents) {
            
            if (isset($defaultParents[$this->getClass()])) {
                
                $result = $this->processValue($defaultParents[$this->getClass()]);
                
                if ($result instanceof DataObject) {
                    return $result->ID;
                }
                
                return $result;
                
            }
            
        }
    }
1101276
public function getRecordIdent()
    {
        $ident = $this->getExternalID();
        if (empty($ident)) {
            $ident = $this->getRecordCode();
        }
        if (empty($ident)) {
            $ident = $this->getRecordID();
        }
        return $ident;
    }
1362717
protected function get_parent_record() {
        global $DB;

        if (!isset($this->parentrecord)) {
            $this->parentrecord = $DB->get_record('event', ['id' => $this->parentid]);
        }

        return $this->parentrecord;
    }
566342
public function getIdentifier($appendIdentifier = null)
    {
        $identifierParts = array_merge($this->parentScopes, [$this->scopeIdentifier, $appendIdentifier]);

        return implode('.', array_filter($identifierParts));
    }
159259
public function getFormId()
    {
        // allowed are a-zA-Z0-9-_:.
        // no spaces

        $form = $this->getForm();
        $formId = $form->getName();

        if ($form instanceof FormCollectionInterface) {
            $formId .= '_' . $this->getEntityContainer()->getName();
        }

        $formId .= '_' . $this->getName();
        return $formId;
    }
830264
public String getParentIdentifier() {

        // Translate null parent to proper identifier
        String parentIdentifier = getModel().getParentIdentifier();
        if (parentIdentifier == null)
            return RootConnectionGroup.IDENTIFIER;

        return parentIdentifier;
        
    }
1022833
public function get_revision() {
        global $CFG;
        if (empty($CFG->langstringcache)) {
            return -1;
        }
        if (isset($CFG->langrev)) {
            return (int)$CFG->langrev;
        } else {
            return -1;
        }
    }
715874
public function getDescription()
    {
        if ($this->description && strpos(strtolower($this->description), '{@inheritdoc}') === false) {
            return $this->description;
        }

        $parentElement = $this->getInheritedElement();
        if ($parentElement instanceof DescriptorAbstract) {
            $parentDescription = $parentElement->getDescription();

            return $this->description
                ? str_ireplace('{@inheritdoc}', $parentDescription, $this->description)
                : $parentDescription;
        }

        return $this->description;
    }
317951
public function getParentEntityDescriptor()
    {
        if (is_null($this->parentEntityDescriptor)) {
            $this->setParentEntityDescriptor(
                EntityDescriptorRegistry::getInstance()
                    ->getDescriptorFor($this->parentEntity)
            );
        }
        return $this->parentEntityDescriptor;
    }
419062
public function getByRef(array $ref, array $parentEntity = [])
    {
        $document = $parentEntity;
        if (strpos($ref['rootDocumentEntityType'], 'parent') === false) {
            if (empty($document['_id']) || $document['_id'] !== $ref['rootDocumentId']) {
                $document = $this->getById($ref['rootDocumentEntityType'], $ref['rootDocumentId']);
            }

            if (count($document) === 0) {
                throw new Exception('Invalid document reference (document cannot be found by Id)');
            }
        }

        $container = $document;
        foreach ($ref['path'] as $pathInDocument) {
            if (!array_key_exists($pathInDocument['field'], $container)) {
                throw new Exception('Could not find the path in document');
            }
            $container = $container[$pathInDocument['field']];
            if (empty($pathInDocument['objectId'])) {
                continue;
            }

            if (!is_array($container)) {
                throw new Exception('Invalid value for path in document');
            }
            $result = array_filter($container, function ($item) use ($pathInDocument) {
                return $item['_id'] === $pathInDocument['objectId'];
            });
            if (count($result) === 0) {
                throw new Exception('Empty result of reference');
            }
            $container = reset($result);
        }
        return $container;
    }