common/models/entities/User.php
public function validateMobileChange( $attribute, $params ) {

		if( !$this->hasErrors() ) {

			$properties		= CoreProperties::getInstance();
			$existingUser	= self::findById( $this->id );

			if( isset( $existingUser ) && $existingUser->mobile !== $this->mobile  && !$properties->isChangeMobile() ) {

				$this->addError( $attribute, Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_CHANGE_USERNAME ) );
			}
		}
	}
public function validateMobileChange( $attribute, $params ) {

		if( !$this->hasErrors() ) {

			$properties		= CoreProperties::getInstance();
			$existingUser	= self::findById( $this->id );

			if( isset( $existingUser ) && $existingUser->mobile !== $this->mobile  && !$properties->isChangeMobile() ) {

				$this->addError( $attribute, Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_CHANGE_USERNAME ) );
			}
		}
	}
public function validateMobileChange ( $ attribute , $ params ) { if ( ! $ this -> hasErrors ( ) ) { $ properties = CoreProperties :: getInstance ( ) ; $ existingUser = self :: findById ( $ this -> id ) ; if ( isset ( $ existingUser ) && $ existingUser -> mobile !== $ this -> mobile && ! $ properties -> isChangeMobile ( ) ) { $ this -> addError ( $ attribute , Yii :: $ app -> coreMessage -> getMessage ( CoreGlobal :: ERROR_CHANGE_USERNAME ) ) ; } } }
Validates mobile to ensure that it does not allow to change while changing user profile.

@param type $attribute
@param type $params
@return void
Validates mobile to ensure that it does not allow to change while changing user profile .