public function tryGetById($id, ClassMetadata $class)
    {
        if (! $class->identifier) {
            throw new InvalidArgumentException(sprintf('Class "%s" does not have an identifier', $class->name));
        }

        $serializedId = serialize($class->getDatabaseIdentifierValue($id));

        return $this->identityMap[$class->name][$serializedId] ?? false;
    }
public function tryGetById($id, ClassMetadata $class)
    {
        if (! $class->identifier) {
            throw new InvalidArgumentException(sprintf('Class "%s" does not have an identifier', $class->name));
        }

        $serializedId = serialize($class->getDatabaseIdentifierValue($id));

        return $this->identityMap[$class->name][$serializedId] ?? false;
    }
public function tryGetById ( $ id , ClassMetadata $ class ) { if ( ! $ class -> identifier ) { throw new InvalidArgumentException ( sprintf ( 'Class "%s" does not have an identifier' , $ class -> name ) ) ; } $ serializedId = serialize ( $ class -> getDatabaseIdentifierValue ( $ id ) ) ; return $ this -> identityMap [ $ class -> name ] [ $ serializedId ] ?? false ; }
Tries to get a document by its identifier hash. If no document is found
for the given hash, FALSE is returned.

@internal

@param mixed $id Document identifier

@return mixed The found document or FALSE.

@throws InvalidArgumentException If the class does not have an identifier.
Tries to get a document by its identifier hash . If no document is found for the given hash FALSE is returned .