Finds the Item model based on its primary key value.
If the model is not found, a 404 HTTP exception will be thrown.
@param integer|boolean $id
@param boolean $search
@return AbstractModel the loaded model
@throws NotFoundHttpException
341048
public function findModel($id = false, $search = false)
    {
        $class = static::getModelClass($this->modelName) . ($search ? 'Search' : '');
        $model = new $class();
        if ($id && (!$model = $model->search(compact('id'))->one())) {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
        return $model;
    }
560384
protected function findModel($id)
    {
        $item = Yii::$app->getAuthManager()->getRole($id);
        if ($item) {
            return new AuthItem($item);
        } else {
            throw new NotFoundHttpException(\Yii::t('app', 'The requested page does not exist.'));
        }
    }
339506
public function findModel($id = null)
    {
        if ($id === null) {
            return new Item();
        }
        if (($model = Item::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(Yii::t('modules/page', 'The requested page does not exist.'));
        }
    }
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.'));
        }
    }
577087
protected function findModel($id)
    {
        if (($model = Message::find()
                ->where(['id' => $id, 'parent' => null])->andWhere(['or', ['from_id' => Yii::$app->user->id], ['user_id' => Yii::$app->user->id]])->limit(1)->one()) !== null
        ) {
            return $model;
        } else {
            throw new NotFoundHttpException (Yii::t('message', 'The requested page does not exist.'));
        }
    }
1294984
public function findOrFail($id)
    {
        if ($model = $this->find($id)) {
            return $model;
        }
        throw (new ModelNotFoundException)->setModel(get_class($this->getModel()));
    }
53325
protected function findModel($id)
    {
        //$model = News::findOne($id);
        $model = $this->module->model('News')->findOne($id);
        if ($model !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(Yii::t($this->tc,'The requested news does not exist'));
        }
    }
706838
public static function find_by_id($id)
	{
		$row = self::oneOrNew($id);

		if (!$row->get('id'))
		{
			return false;
		}

		return $row;
	}
1207567
protected function findModel($id)
    {
        if (($model = TermType::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
        }
    }
973647
protected function findModel($id)
    {
        $commentModel = $this->getModule()->commentModelClass;
        if (null !== ($model = $commentModel::findOne($id))) {
            return $model;
        } else {
            throw new NotFoundHttpException(Yii::t('yii2mod.comments', 'The requested page does not exist.'));
        }
    }
126487
public function update(array $searchData, string $id)
    {
        /**
         * @var \Search\Model\Entity\SavedSearch
         */
        $entity = $this->searchTable->get($id);
        $entity = $this->normalize($entity, $entity->get('content'), $searchData);

        return $this->searchTable->save($entity);
    }
1152002
public function findById($id) {
        $this->sqlBuilder->addWhere($this->primaryKey, $id);
        $sql = $this->sqlBuilder->buildQueryString();
        return $this->db->getOneRow($sql);
    }
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.'));
        }
    }
331665
protected function findModel($id)
    {
        if (($model = Term::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
        }
    }
301000
protected function find($id)
    {
        $model = $this->model;
        $this->model = $model::find($id);
        if (!$this->model) {
            // belts and braces check - no model = doesn't exist (without being masked missing object property)
            // potential candidate for custom exception handling
            return false;
        }
        return $this->model->exists;
    }
509028
protected function findModel($id)
    {
        if (is_array($id)) {
            $model = TaxonomyVocabulary::findAll($id);
        } else {
            $model = TaxonomyVocabulary::findOne($id);
        }
        if ($model !== null) {
            return $model;
        } else {
            throw new HttpException(404);
        }
    }
437970
public function findById($id)
    {
        foreach ($this->items as $page) {
            if ($page->getId() == $id) {
                return $page;
            } else if ($found = $page->getPages()->findById($id)) {
                return $found;
            }
        }
    }