frontend/models/forms/ChangeNameForm.php
/**
     * Change name for User
     *
     * @return bool
     */
Change name for User
@return bool
Change name for User @return bool
public function changeName()
    {
        $user = Users::findIdentity(Yii::$app->user->identity->getId());
        if ($user) {
            if ($user->license_type == Licenses::TYPE_PAYED_BUSINESS_ADMIN) {
                $user->user_company_name = $this->user_name;
            } else {
                $user->user_name = $this->user_name;
            }
            if ($user->save()) {
                return true;
            }
        }
        return false;
    }
public function changeName ( ) { $ user = Users :: findIdentity ( Yii :: $ app -> user -> identity -> getId ( ) ) ; if ( $ user ) { if ( $ user -> license_type == Licenses :: TYPE_PAYED_BUSINESS_ADMIN ) { $ user -> user_company_name = $ this -> user_name ; } else { $ user -> user_name = $ this -> user_name ; } if ( $ user -> save ( ) ) { return true ; } } return false ; }
Change name for User
 @return bool
Change name for User @return bool