Finds the Term model based on its primary key value.
If the model is not found, a 404 HTTP exception will be thrown.

@param integer $id

@return Term the loaded model
@throws NotFoundHttpException if the model cannot be found
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.'));
        }
    }
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.'));
        }
    }
1347576
public function load($id)
    {
        $spiUrlAlias = $this->urlAliasHandler->loadUrlAlias($id);
        $path = $this->extractPath(
            $spiUrlAlias,
            null,
            $this->settings['showAllTranslations'],
            $this->settings['prioritizedLanguageList']
        );

        if ($path === false) {
            throw new NotFoundException('URLAlias', $id);
        }

        return $this->buildUrlAliasDomainObject($spiUrlAlias, $path);
    }
68035
protected function findModel($id, $vid)
    {
        if (is_array($id)) {
            $model = TaxonomyTerm::find()->where(['vid' => $vid, 'id' => $id])->all();
        } else {
            $model = TaxonomyTerm::find()->where(['vid' => $vid, 'id' => $id])->one();
        }
        if ($model !== null) {
            return $model;
        } else {
            throw new HttpException(404);
        }
    }
103821
public static function getByIdentifier($id)
    {
        $file = config('filer.hash_routes') ? static::whereHash($id)->first() : static::find($id);

        if (!$file) {
            throw (new ModelNotFoundException)->setModel(static::class);
        }

        return $file;
    }
465680
public function findById($id)
    {
        if (count($this->primaryKeys) > 1) {
            throw new \LogicException(__METHOD__ . '|Cannot use findById() method for table with multiple primary keys !');
        }

        $field = reset($this->primaryKeys);

        return $this->findByKeys(array($field => $id));
    }
962672
protected function findModel($id)
    {
        if (($model = ProductTypeMeta::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
        }
    }
137962
public function getOrFail($id)
    {

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

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

        throw new ResourceNotFoundException("$typeName #$id not found.");
    }
1055331
protected function findUser($id)
    {
        if (($model = User::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
        }
    }
1101397
public function find($id)
    {
        $rel = $this->currentOrClone();
        $modelClass = $this->modelClass;
        $tableName  = $modelClass::tableName();
        $first = $rel->where([$tableName . '.' . $modelClass::primaryKey() => $id])->first();
        if (!$first) {
            throw new RecordNotFoundException(sprintf(
                "Couldn't find %s with %s=%s",
                $this->modelClass,
                $modelClass::primaryKey(),
                $id
            ));
        }
        return $first;
    }
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.'));
        }
    }
497057
public function find($id)
    {

        $query = $this->getModel()->newQuery();
        $this->callBeforeListeners('find', [$query]);

        if (!$model = $query->find($id)) {
            return;
        }

        $this->callAfterListeners('find', [$model]);
        return $model;
    }
337827
public function getModelByPrimaryKey($id)
    {
        foreach($this->models as $model)
        {
            $primaryKey = $model->getKeyName();
            if($model->$primaryKey == $id)
                return $model;
        }
    }
418557
protected function findModel($id)
    {
        $user = User::findOne($id);
        if ($user === null) {
            throw new NotFoundHttpException('The requested page does not exist');
        }
        return $user;
    }
1240897
protected function findModel($id)
    {
        $auth = Yii::$app->getAuthManager();
        $item = $this->type === Item::TYPE_ROLE ? $auth->getRole($id) : $auth->getPermission($id);
        if ($item) {
            return new AdminAuthItem($item);
        } else {
            throw new NotFoundHttpException(Yii::t('yuncms', 'The requested page does not exist.'));
        }
    }
65335
protected function loadModel($id)
    {
        if (empty($this->additionalCriteriaOnLoadModel)) {
            $model = CActiveRecord::model($this->modelName)->findByPk($id);
        } else {
            $finder = CActiveRecord::model($this->modelName);
            $c = new CDbCriteria($this->additionalCriteriaOnLoadModel);
            $c->mergeWith(
                array(
                    'condition' => $finder->tableSchema->primaryKey . '=:id',
                    'params' => array(':id' => $id),
                )
            );
            $model = $finder->find($c);
        }
        if (isset($model)) {
            return $model;
        }
        if ($this->additionalCriteriaOnLoadModel) {
            throw new CHttpException(404, 'Unable to find the requested object.');
        }
    }
904245
protected function findModel($id)
    {
        if (($model = Product::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
        }
    }