src/Model/UserValidationTrait.php
protected function validationOldPassword($validator) {
		$validator->setProvider('userBehavior', $this);
		$validator->setProvider('userTable', $this->_table);

		$validator->add('old_password', 'notBlank', [
			'rule' => 'notBlank',
			'message' => __d('user_tools', 'Enter your old password.')
		]);
		$validator->add('old_password', 'oldPassword', [
			'rule' => ['validateOldPassword', 'password'],
			'provider' => 'userBehavior',
			'message' => __d('user_tools', 'Wrong password, please try again.')
		]);

		return $validator;
	}
protected function validationOldPassword($validator) {
		$validator->setProvider('userBehavior', $this);
		$validator->setProvider('userTable', $this->_table);

		$validator->add('old_password', 'notBlank', [
			'rule' => 'notBlank',
			'message' => __d('user_tools', 'Enter your old password.')
		]);
		$validator->add('old_password', 'oldPassword', [
			'rule' => ['validateOldPassword', 'password'],
			'provider' => 'userBehavior',
			'message' => __d('user_tools', 'Wrong password, please try again.')
		]);

		return $validator;
	}
protected function validationOldPassword ( $ validator ) { $ validator -> setProvider ( 'userBehavior' , $ this ) ; $ validator -> setProvider ( 'userTable' , $ this -> _table ) ; $ validator -> add ( 'old_password' , 'notBlank' , [ 'rule' => 'notBlank' , 'message' => __d ( 'user_tools' , 'Enter your old password.' ) ] ) ; $ validator -> add ( 'old_password' , 'oldPassword' , [ 'rule' => [ 'validateOldPassword' , 'password' ] , 'provider' => 'userBehavior' , 'message' => __d ( 'user_tools' , 'Wrong password, please try again.' ) ] ) ; return $ validator ; }
Configures the validator with rules to check the old password

@param \Cake\Validation\Validator $validator Validator
@return \Cake\Validation\Validator
Configures the validator with rules to check the old password