public function reverseTransform($idObject)
    {
        if (!is_array($idObject)) {
            return;
        }

        $identifier = current(array_values($this->om->getClassMetadata($this->entityName)->getIdentifier()));
        $id = $idObject[$identifier];

        $object = $this->om
            ->getRepository($this->entityName)
            ->findOneBy([$identifier => $id]);

        if (null === $object) {
            throw new TransformationFailedException(sprintf(
                'An object with identifier key "%s" and value "%s" does not exist!',
                $identifier, $id
            ));
        }

        return $object;
    }
public function reverseTransform($idObject)
    {
        if (!is_array($idObject)) {
            return;
        }

        $identifier = current(array_values($this->om->getClassMetadata($this->entityName)->getIdentifier()));
        $id = $idObject[$identifier];

        $object = $this->om
            ->getRepository($this->entityName)
            ->findOneBy([$identifier => $id]);

        if (null === $object) {
            throw new TransformationFailedException(sprintf(
                'An object with identifier key "%s" and value "%s" does not exist!',
                $identifier, $id
            ));
        }

        return $object;
    }
public function reverseTransform ( $ idObject ) { if ( ! is_array ( $ idObject ) ) { return ; } $ identifier = current ( array_values ( $ this -> om -> getClassMetadata ( $ this -> entityName ) -> getIdentifier ( ) ) ) ; $ id = $ idObject [ $ identifier ] ; $ object = $ this -> om -> getRepository ( $ this -> entityName ) -> findOneBy ( [ $ identifier => $ id ] ) ; if ( null === $ object ) { throw new TransformationFailedException ( sprintf ( 'An object with identifier key "%s" and value "%s" does not exist!' , $ identifier , $ id ) ) ; } return $ object ; }
Transforms an array including an identifier to an object.

@param array $idObject

@throws TransformationFailedException if object is not found

@return object|null
Transforms an array including an identifier to an object .