src/ngrest/base/actions/ViewAction.php
public function run($id)
    {
        $model = $this->findModel($id);

        if ($this->checkAccess) {
            call_user_func($this->checkAccess, $this->id, $model);
        }

        if (!Yii::$app->adminuser->identity->is_api_user) {
            $modelClass = $this->modelClass;
            $table = $modelClass::tableName();
            $alias = Yii::$app->adminmenu->getApiDetail($modelClass::ngRestApiEndpoint());
            UserOnline::lock(Yii::$app->adminuser->id, $table, $id, 'lock_admin_edit_crud_item', ['table' => $alias['alias'], 'id' => $id, 'module' => $alias['module']['alias']]);
        }
        
        return $model;
    }
public function run($id)
    {
        $model = $this->findModel($id);

        if ($this->checkAccess) {
            call_user_func($this->checkAccess, $this->id, $model);
        }

        if (!Yii::$app->adminuser->identity->is_api_user) {
            $modelClass = $this->modelClass;
            $table = $modelClass::tableName();
            $alias = Yii::$app->adminmenu->getApiDetail($modelClass::ngRestApiEndpoint());
            UserOnline::lock(Yii::$app->adminuser->id, $table, $id, 'lock_admin_edit_crud_item', ['table' => $alias['alias'], 'id' => $id, 'module' => $alias['module']['alias']]);
        }
        
        return $model;
    }
public function run ( $ id ) { $ model = $ this -> findModel ( $ id ) ; if ( $ this -> checkAccess ) { call_user_func ( $ this -> checkAccess , $ this -> id , $ model ) ; } if ( ! Yii :: $ app -> adminuser -> identity -> is_api_user ) { $ modelClass = $ this -> modelClass ; $ table = $ modelClass :: tableName ( ) ; $ alias = Yii :: $ app -> adminmenu -> getApiDetail ( $ modelClass :: ngRestApiEndpoint ( ) ) ; UserOnline :: lock ( Yii :: $ app -> adminuser -> id , $ table , $ id , 'lock_admin_edit_crud_item' , [ 'table' => $ alias [ 'alias' ] , 'id' => $ id , 'module' => $ alias [ 'module' ] [ 'alias' ] ] ) ; } return $ model ; }
Return the model for a given resource id.

@return yii\db\ActiveRecordInterface
Return the model for a given resource id .