Finds the model based on its primary key value.
If the model is not found, a 404 HTTP exception will be thrown.
@param integer $id
@return ActiveRecord the loaded model
@throws NotFoundHttpException if the model cannot be found
183874
public function findModel($id)
    {
        $model = call_user_func_array([$this->MainModel, 'findOne'], [$id]);
        if ($model !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
324219
public static function find(int $id): ORM
    {
        if (! ($instance = self::instance()->getById($id))) {
            throw new DatabaseException('Could not find ' . __CLASS__ .
                ' where primary key is ' . $id);
        }
        return $instance;
    }
1237798
public static function findById($id, $throwException = true)
    {
        $e = $throwException ? new ServerErrorHttpException("Property with id $id not found") : false;

        return static::loadModel(
            $id,
            false,
            true,
            86400,
            $e,
            true
        );
    }
812442
protected function findOrFail($id)
    {
        $model = $this->model;
        if ($this->withTrashed()) {
            return $model::withTrashed()->findOrFail($id);
        } else {
            return $model::findOrFail($id);
        }
    }
44731
protected function findModel($id)
    {
        $item = Yii::$app->authManager->getRule($id);
        if ($item) {
            return new BizRule($item);
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
590329
public function findByIntOrFail(int $id): Model
    {
        $model = $this->findByInt($id);
        if (empty($model)) {
            throw new ResourceNotFoundException();
        }

        return $model;
    }
1208835
public function find($id)
    {
        return $this
            ->getQueryBuilder()
            ->field('id')->equals(new \MongoId($id))
            ->getQuery()
            ->getSingleResult()
        ;
    }
8907
public static function findOrFail($id, $columns = array('*'))
	{
		if ( ! is_null($model = static::find($id, $columns))) return $model;

		throw new ModelNotFoundException(get_called_class().' model not found');
	}
84430
protected function findModel($id)
    {
        if (($model = Order::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
        }
    }
1013434
public function findModel($id)
    {
        if (($model = Category::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException (Yii::t('system', 'The requested page does not exist.'));
        }
    }
521470
private function find($id): ?Model
    {
        try {
            return $this->repository->findOrFail($id);
        } catch (ModelNotFoundException $exception) {
            return null;
        }
    }
1043769
protected function findModel($id)
    {
        if (($model = Rubric::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(Module::t('core', 'The requested model does not exist.'));
        }
    }
461656
public function find($id)
    {
        try
        {
            $model = $this->model->findOrFail($id);
        }
        catch(ModelNotFoundException $e)
        {
            throw new NotFoundException;
        }

        return $model;
    }
72864
protected function findModel(int $id)
    {
        $settingModelClass = $this->modelClass;

        if (($model = $settingModelClass::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(Yii::t('yii2mod.settings', 'The requested page does not exist.'));
        }
    }
536746
public function find($id)
    {
        if (!$this->isRepositoryReadable()) {
            throw $this->createNotReadableException();
        }

        return $this->trigger(__FUNCTION__, [
            'id' => $id,
        ]);
    }
1122419
protected function findModel($id)
    {
        /* @var $module Module */
        $module = Yii::$app->getModule(Module::$name);
        $commentModelData = $module->model('comment');
        /** @var CommentModel $commentModel */
        $commentModel = Yii::createObject($commentModelData);
        if (($model = $commentModel::findOne($id)) !== NULL) {
            return $model;
        } else {
            throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));
        }
    }
345439
protected function findModel($id)
    {
        if (($model = Role::findByName($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(Yii::t('maddoger/user', 'The requested role does not exist.'));
        }
    }