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