/**
* {@inheritdoc}
*/
public function reverseTransform($value)
{
if (!$value) {
return null;
}
if (null === ($entity = $this->repository->findOneBy(array($this->identifier => $value)))) {
throw new TransformationFailedException(sprintf('Object "%s" with identifier "%s"="%s" does not exist.', $this->repository->getClassName(), $this->identifier, $value));
}
return $entity;
}