src/BaseAction.php
public function getModel($id)
    {
        if (!is_array($id)) {
            $id = [$id];
        }

        $model = call_user_func($this->findModel, $id);
        if ($model === null) {
            throw new NotFoundHttpException('The requested page does not exist.');
        }

        return $model;
    }
public function getModel($id)
    {
        if (!is_array($id)) {
            $id = [$id];
        }

        $model = call_user_func($this->findModel, $id);
        if ($model === null) {
            throw new NotFoundHttpException('The requested page does not exist.');
        }

        return $model;
    }
public function getModel ( $ id ) { if ( ! is_array ( $ id ) ) { $ id = [ $ id ] ; } $ model = call_user_func ( $ this -> findModel , $ id ) ; if ( $ model === null ) { throw new NotFoundHttpException ( 'The requested page does not exist.' ) ; } return $ model ; }
If the data model is not found, an exception is thrown HTTP 404
@param mixed $id
@return ActiveRecord
@throws NotFoundHttpException
If the data model is not found an exception is thrown HTTP 404