Transforms a string (id) to an object

@param  string $id
@return Object|null
@throws TransformationFailedException if object is not found.
762751
public function reverseTransform($id)
    {
        if (!$id) {
            return null;
        }

        $object = $this->om
            ->getRepository($this->class)
            ->find($id)
        ;

        if (! $object) {
            throw new TransformationFailedException();
        }

        return $object;
    }
733016
public function transform($value)
    {
        if (null === $value) {
            return null;
        }

        if (!$value instanceof Language) {
            throw new TransformationFailedException('Expected a ' . Language::class . ' object.');
        }

        return $value->languageCode;
    }
875714
public function update($id)
    {
        try
        {
            $update = $this->repo->update($id, Input::all());
        } catch (ValidationErrorException $exception)
        {
            return $this->respondNotValid($exception);
        }

        if ( ! $update)
        {
            return $this->respondNotFound();
        }

        $item = $this->repo->getById($id);

        return $this->response->item($item, new $this->transformerClass);
    }
209235
public function setId($id = null)
        {
            if (null !== $id && !is_string($id) && !is_numeric($id)) {
                throw new Exception(
                        'Invalid argument: $id must be a string, number or null');
            }

            $this->_id = null === $id ? $id : (string) $id;

            return $this;
        }
663703
public function transform($id)
    {
        if (null === $id) {
            return null;
        } else if (is_string($id)) {
            /** @var Group|null $entity */
            $entity = $this->om->getRepository('FOMUserBundle:Group')
                ->findOneBy(array('id' => $id));
            return $entity;
        } elseif (is_array($id)) {
            if (count($id) === 0) {
                return null;
            }
            $result = new ArrayCollection();
            foreach($id as $value) {
                $group = $this->om->getRepository('FOMUserBundle:Group')
                    ->findOneBy(array('id' => $value));
                if ($group !== null) {
                    $result->add($group);
                }
            }
            return $result;
        } else {
            return null;
        }
    }
649458
public function reverseTransform($id)
    {
        if (!$id) {
            return null;
        }
        if (!$entity = $this->retrieve($id)) {
            throw new TransformationFailedException(sprintf(
                '%s#%s cannot be found.',
                $this->entityClass,
                $id
            ));
        }

        return $entity;
    }
1337826
public function reverseTransform($id)
    {
        if ('' === $id || null === $id) {
            return;
        }

        if (!is_numeric($id)) {
            throw new UnexpectedTypeException($id, 'numeric'.$id);
        }

        $entity = $this->entityManager->getRepository($this->class)->findOneById($id);

        if ($entity === null) {
            throw new TransformationFailedException(sprintf('The entity with key "%s" could not be found', $id));
        }

        return $entity;
    }
118219
public function reverseTransform($cID)
    {
        if (!is_numeric($cID) || $cID == 0) {
            return null;
        }

        $rep = $this->entityManager->getRepository('Concrete\Core\Page\Page');

        $c = $rep->find($cID);
        if (!is_object($c) || $c->isError()) {
            throw new TransformationFailedException('Invalid page ID.');
        }

        return $c;
    }
1202624
private function loadSolution(string $id)
    {
        $id = $this->resolveAlias($id);
        if (!$this->hasSolution($id)) {
            return null;
        }

        if ($this->fullyLoadedSolutions[$id]) {
            return $this->solutions[$id];
        } else {
            $loader = $this->solutions[$id];
            $this->solutions[$id] = $solution = $loader();
            $this->onLoadSolution($solution);
            $this->fullyLoadedSolutions[$id] = true;

            return $solution;
        }
    }
144150
public function reverseTransform($uID)
    {
        if (!is_numeric($uID) || $uID == 0) {
            return null;
        }

        $rep = $this->entityManager->getRepository('Concrete\Core\User\User');

        $u = $rep->find($uID);
        if (!is_object($u) || $u->isError()) {
            throw new TransformationFailedException('Invalid user ID.');
        }

        return $u;
    }
88645
public function get($id)
    {
        if (false === $this->has($id)) {
            $errMsg = sprintf('Invalid create %s', $id);
            throw new Exception\NotFoundDoctrineObjectHydratorException($errMsg);
        }

        return clone $this->prototype[$id];
    }
1112973
public function fetch($id)
    {
        if (!is_string($id)) {
            throw new InvalidArgumentException(1, 'string');
        }

        if (($frozenObject = $this->doFetch($id)) !== false) {
            $this->fetchArray($frozenObject['objects'][$id]['state']);
            $object = $this->freezer->thaw($frozenObject);
        } else {
            throw new ObjectNotFoundException(
                sprintf('Object with id "%s" could not be fetched.', $id)
            );
        }

        return $object;
    }
1358803
public function raw($id) {
		// Format id
		$id = $this->_format($id);
		// Verify existence
		if(!$this->has($id)) {
			throw new NotFoundException("'$id' value does not exist");
		}
		// Remove value
		return $this->values[$id]->getRawValue();
	}
1368840
public function reverseTransform($value): ?APIRole
    {
        if (empty($value)) {
            return null;
        }

        try {
            return $this->roleService->loadRole($value);
        } catch (NotFoundException $e) {
            throw new TransformationFailedException($e->getMessage(), $e->getCode(), $e);
        }
    }
326723
public function getObjectById($id)
    {
        if (isset($this->objects[$id])) {
            return $this->objects[$id];
        } else {
            return null;
        }
    }
393184
public function rawDeleteById($id)
        {
            if (!$id) {
                return null;
            }

            $query = new Query($this);
            $query->where($this->id_column, $id);
            $query->generateDeleteSQL();

            $this->deleteB2DBObjectFromCache($id);

            return Statement::getPreparedStatement($query)->execute();
        }
865250
public function resolve($id)
    {
        foreach ($this->transformers as $contentType => $transformer) {
            if (stripos($id, $contentType) === 0) {
                return $transformer;
            }
        }
    }