getId(); } public function reverseTransform($value) { if (empty($value)) { return null; } $entity = $this->entityManager->getRepository($this->class)->find($value); if (null === $entity) { throw new TransformationFailedException(sprintf('No %s with id %d found', $this->class, $value)); } return $entity; } }