src/models/UserOnline.php
public static function lock($userId, $table, $pk, $translation, array $translationArgs = [])
    {
        $model = self::findOne(['user_id' => $userId]);
        
        if ($model) {
            $model->updateAttributes([
                'last_timestamp' => time(),
                'lock_table' => $table,
                'lock_pk' => $pk,
                'lock_translation' => $translation,
                'lock_translation_args' => Json::encode($translationArgs),
            ]);
        }
    }
public static function lock($userId, $table, $pk, $translation, array $translationArgs = [])
    {
        $model = self::findOne(['user_id' => $userId]);
        
        if ($model) {
            $model->updateAttributes([
                'last_timestamp' => time(),
                'lock_table' => $table,
                'lock_pk' => $pk,
                'lock_translation' => $translation,
                'lock_translation_args' => Json::encode($translationArgs),
            ]);
        }
    }
public static function lock ( $ userId , $ table , $ pk , $ translation , array $ translationArgs = [ ] ) { $ model = self :: findOne ( [ 'user_id' => $ userId ] ) ; if ( $ model ) { $ model -> updateAttributes ( [ 'last_timestamp' => time ( ) , 'lock_table' => $ table , 'lock_pk' => $ pk , 'lock_translation' => $ translation , 'lock_translation_args' => Json :: encode ( $ translationArgs ) , ] ) ; } }
Lock the user for an action.

@param integer $userId
@param string $table
@param string $pk
@param string $translation
@param array $translationArgs
Lock the user for an action .