public static function updateRole($id, $role)
    {
        $activity = static::find()->where(['user_id' => $id])->limit(1)->one();
        if (empty($activity)) {
            Log::error('Cannot update user activity', $id, __METHOD__);
            return;
        }
        $activity->user_role = $role;
        if (!$activity->save()) {
            Log::error('Cannot update user activity', $id, __METHOD__);
            return;
        }
        Podium::getInstance()->podiumCache->delete('forum.lastactive');
    }
public static function updateRole($id, $role)
    {
        $activity = static::find()->where(['user_id' => $id])->limit(1)->one();
        if (empty($activity)) {
            Log::error('Cannot update user activity', $id, __METHOD__);
            return;
        }
        $activity->user_role = $role;
        if (!$activity->save()) {
            Log::error('Cannot update user activity', $id, __METHOD__);
            return;
        }
        Podium::getInstance()->podiumCache->delete('forum.lastactive');
    }
public static function updateRole ( $ id , $ role ) { $ activity = static :: find ( ) -> where ( [ 'user_id' => $ id ] ) -> limit ( 1 ) -> one ( ) ; if ( empty ( $ activity ) ) { Log :: error ( 'Cannot update user activity' , $ id , __METHOD__ ) ; return ; } $ activity -> user_role = $ role ; if ( ! $ activity -> save ( ) ) { Log :: error ( 'Cannot update user activity' , $ id , __METHOD__ ) ; return ; } Podium :: getInstance ( ) -> podiumCache -> delete ( 'forum.lastactive' ) ; }
Updates role after change.
@param int $id
@param int $role
Updates role after change .