@param $id

@return string
@throws NotFoundHttpException
160988
public function actionView($id)
    {
        $model = $this->findModel($id);
        $providerTermRelationships = new \yii\data\ArrayDataProvider([
            'allModels' => $model->termRelationships,
        ]);

        return $this->render('view', [
            'model'                     => $this->findModel($id),
            'providerTermRelationships' => $providerTermRelationships,
        ]);
    }
625300
public function actionQuery($id)
    {
        Yii::$app->response->format = Response::FORMAT_JSON;
        $payment = $this->findModel($id);
        if (!$this->module->hasGateway($payment->gateway)) {
            throw new NotFoundHttpException("Unknown payment gateway '{$payment->payment}'");
        }
        /** @var \yuncms\payment\BaseGateway $gateway */
        $gateway = $this->module->getGateway($payment->gateway);
        $status = $gateway->queryOrder($payment->id);
        if ($status) {
            return ['status' => 'success'];
        } else {
            return ['status' => 'pending'];
        }
    }
242528
protected function getMedia($id)
    {
        $media = $this->getMediaManager()->findOneBy(['id' => $id]);

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

        return $media;
    }
462136
protected function getUser($id)
    {
        $user = $this->userManager->findUserBy(['id' => $id]);

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

        return $user;
    }
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.');
        }
    }
937614
public function viewAction($id)
    {
        $content = $this->contentManager->getContentById($id);

        if ($content === null) {
            throw EntityNotFoundException::fromClassNameAndIdentifier(
                $this->configurationManager->getEntityClass('content'),
                [$id]
            );
        }

        return $this->render('@SherlockodeAdvancedContent/Content/view.html.twig', [
            'content' => $content,
        ]);
    }
768240
public function get($id) {
		// Format id
		$id = $this->_format($id);
		// Verify existence
		if(!$this->has($id)) {
			throw new NotFoundException("'$id' value does not exist");
		}
		// Get value
		return $this->values[$id]->getValue();
	}
24707
public function actionDelete($id)
    {
        if (($model = PaymentMethod::findOne($id)) !== null) {
            $model->delete();
            return $this->redirect(['index']);
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
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;
    }
307397
protected function findModel($id)
    {
        $query = Fans::find()
            ->andWhere([
                'id' => $id,
                'wid' => $this->getWechat()->id
            ]);
        if (($model = $query->one()) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
1141628
protected function getOrder($id)
    {
        $order = $this->orderManager->findOneBy(['id' => $id]);

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

        return $order;
    }
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;
    }
390868
protected function getInvoice($id)
    {
        $invoice = $this->invoiceManager->findOneBy(['id' => $id]);

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

        return $invoice;
    }
137962
public function getOrFail($id)
    {

        if ($model = $this->get($id)) {
            return $model;
        }

        $typeName = Type::of($this->prototype());

        throw new ResourceNotFoundException("$typeName #$id not found.");
    }
751176
public function getOrFail($id)
    {
        if ($model = $this->get($id)) {
            return $model;
        }

        throw (new NotFoundException("No results for id $id"))->setModel(get_class($this->model));
    }
1090980
protected function findModel($id)
    {
        $model = $this->module->model('Content')->findOne($id);
        if ($model !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
651326
public function show($id)
    {
        $modelName = $this->modelFullName;
        $model = $modelName::find($id);
        if(!$model) throw new NotFoundException('There is no Resource with id = ' . $id . ' !');
        return $model;
    }