Retrieves page with id $id or throws an exception if it doesn't exist.

@param $id

@throws NotFoundHttpException

@return PageInterface
434829
protected function getPage($id)
    {
        $page = $this->pageManager->findOneBy(['id' => $id]);

        if (null === $page) {
            throw new NotFoundHttpException(sprintf('Page (%d) not found', $id));
        }

        return $page;
    }
1233797
protected function getBlock($id)
    {
        $block = $this->blockManager->findOneBy(['id' => $id]);

        if (null === $block) {
            throw new NotFoundHttpException(sprintf('Block (%d) not found', $id));
        }

        return $block;
    }
1147250
public function loadUrlAlias($id)
    {
        list($parentId, $textMD5) = explode('-', $id);
        $data = $this->gateway->loadRow($parentId, $textMD5);

        if (empty($data)) {
            throw new NotFoundException('URLAlias', $id);
        }

        $data['raw_path_data'] = $this->gateway->loadPathData($data['id']);

        return $this->mapper->extractUrlAliasFromData($data);
    }
1136553
public function get($id)
    {
        if (empty($id)) {
            throw new \Exception('cannot load object with empty id');
        }

        $params = new RequestParams(RequestOps::GET, $this->resourceMetadata, $id);
        $jsonResponse = $this->request($params);

        if ($jsonResponse == false) {
            throw new Exception('Error retrieving data');
        }

        $inst = $this->createResourceInst($jsonResponse, $this->resourceMetadata->resourceClass);

        $this->postProcess($inst);

        return $inst;
    }
875402
public function findInvoiceOrFail(string $id)
    {
        $invoice = $this->findInvoice($id);

        if (is_null($invoice)) {
            throw new NotFoundHttpException('The requested page does not exist.');
        }

        return $invoice;
    }
602130
public function get(string $id): RouteInterface
    {
        if(!$this->has($id)){
            throw new NotFoundRouteException(sprintf("没有找到与唯一标识符是[%s]的路由", $id));
        }
        return $this->routes[$id];
    }
680579
protected function getTag($id)
    {
        $tag = $this->tagManager->find($id);

        if (null === $tag) {
            throw new NotFoundHttpException(sprintf('Tag (%d) not found', $id));
        }

        return $tag;
    }
564227
protected function findModel($id)
    {
        if (($model = \yongtiger\admin\models\Log::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
984103
protected function getAddress($id)
    {
        $address = $this->addressManager->findOneBy(['id' => $id]);

        if (null === $address) {
            throw new NotFoundHttpException(sprintf('Address (%d) not found', $id));
        }

        return $address;
    }
1014621
protected function findModel($id)
    {
        $class = $this->userClassName;
        if (($user = $class::findIdentity($id)) !== null) {
            return new Assignment($id, $user);
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
281911
public function get($id)
    {
        if ($this->has($id) === false)
        {
            $message = (string) 'Class (%s) does not exists';

            throw new NotFoundException(sprintf($message, $id));
        }

        $reflection = new \ReflectionClass($id);

        if ($constructor = $reflection->getConstructor())
        {
            $arguments = $this->arguments($constructor);

            return $reflection->newInstanceArgs($arguments);
        }

        return new $id;
    }
461656
public function find($id)
    {
        try
        {
            $model = $this->model->findOrFail($id);
        }
        catch(ModelNotFoundException $e)
        {
            throw new NotFoundException;
        }

        return $model;
    }
174001
protected function findModel($id)
    {
        if (($model = TermOfProductType::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
        }
    }
1327516
public function find($id)
    {
        $response = $this->client->request('GET', sprintf('/%s/%s', $this->name, $id));
        $json = (string) $response->getBody();

        if (404 === $response->getStatusCode()) {
            throw new Exception('Document does not exist');
        }

        return JSONEncoder::decode($json);
    }
608662
protected function getSite($id)
    {
        $site = $this->siteManager->findOneBy(['id' => $id]);

        if (null === $site) {
            throw new NotFoundHttpException(sprintf('Site (%d) not found', $id));
        }

        return $site;
    }
598888
public function find($id)
    {
        if (trim($id) == "") {
            throw new Exception\NotFound('dispute with id "' . $id . '" not found');
        }

        try {
            $path = $this->_config->merchantPath() . '/disputes/' . $id;
            $response = $this->_http->get($path);
            return Dispute::factory($response['dispute']);
        } catch (Exception\NotFound $e) {
            throw new Exception\NotFound('dispute with id "' . $id . '" not found');
        }
    }
683280
public function load($id)
    {
        $row = $this->gateway->loadUrlWildcardData($id);

        if (empty($row)) {
            throw new NotFoundException('UrlWildcard', $id);
        }

        return $this->mapper->extractUrlWildcardFromRow($row);
    }