protected function retrieveOr404($entityId, $loaderId)
    {
        if (!$this->container->has($loaderId)) {
            throw new NotFoundHttpException(sprintf('Unknow required loader : "%s"',
                $loaderId
            ));
        }

        if (!$entity = $this->container->get($loaderId)->retrieve($entityId)) {
            throw $this->create404($entityId, $loaderId);
        }

        return $entity;
    }
protected function retrieveOr404($entityId, $loaderId)
    {
        if (!$this->container->has($loaderId)) {
            throw new NotFoundHttpException(sprintf('Unknow required loader : "%s"',
                $loaderId
            ));
        }

        if (!$entity = $this->container->get($loaderId)->retrieve($entityId)) {
            throw $this->create404($entityId, $loaderId);
        }

        return $entity;
    }
protected function retrieveOr404 ( $ entityId , $ loaderId ) { if ( ! $ this -> container -> has ( $ loaderId ) ) { throw new NotFoundHttpException ( sprintf ( 'Unknow required loader : "%s"' , $ loaderId ) ) ; } if ( ! $ entity = $ this -> container -> get ( $ loaderId ) -> retrieve ( $ entityId ) ) { throw $ this -> create404 ( $ entityId , $ loaderId ) ; } return $ entity ; }
Retrieves entity for given id into given repository service.

@param $entityId
@param $loaderId

@return Object

@throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
Retrieves entity for given id into given repository service .