Form/DataTransformer/PersonToIdTransformer.php
public function reverseTransform($id)
    {
        if (!$id) {
            return null;
        }

        $issue = $this->om
            ->getRepository('ChillPersonBundle:Person')
            ->findOneBy(array('id' => $id))
        ;

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

        return $issue;
    }
public function reverseTransform($id)
    {
        if (!$id) {
            return null;
        }

        $issue = $this->om
            ->getRepository('ChillPersonBundle:Person')
            ->findOneBy(array('id' => $id))
        ;

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

        return $issue;
    }
public function reverseTransform ( $ id ) { if ( ! $ id ) { return null ; } $ issue = $ this -> om -> getRepository ( 'ChillPersonBundle:Person' ) -> findOneBy ( array ( 'id' => $ id ) ) ; if ( null === $ issue ) { throw new TransformationFailedException ( sprintf ( 'An issue with id "%s" does not exist!' , $ id ) ) ; } return $ issue ; }
Transforms a string (id) to an object (issue).

@param  string $id

@return Issue|null

@throws TransformationFailedException if object (issue) is not found.
Transforms a string ( id ) to an object ( issue ) .