if (\is_object($value) && method_exists($value, 'getId')) {
return $value;
}
$resource = $this->repository->findOneBy([
$this->identifier => $value,
]);
$resource = $this->repository->find($value);
if (null === $resource) {
throw new TransformationFailedException(\sprintf('Object "%s" with identifier "%s" does not exist.', $this->repository->getClassName(), $value));
throw new TransformationFailedException(\sprintf('Object "%s" with identifier "%s"="%s" does not exist.', $this->repository->getClassName(), $this->identifier, $value));