src/Model/Behavior/UserBehavior.php
public function resetPassword(Entity $user) {
		if (!$user->getErrors()) {
			$user->{$this->_field('password')} = $this->hashPassword($user->{$this->_field('password')});
			$user->{$this->_field('passwordToken')} = null;
			$user->{$this->_field('passwordTokenExpires')} = null;

			return $this->_table->save($user, ['checkRules' => false]);
		}

		return false;
	}
public function resetPassword(Entity $user) {
		if (!$user->getErrors()) {
			$user->{$this->_field('password')} = $this->hashPassword($user->{$this->_field('password')});
			$user->{$this->_field('passwordToken')} = null;
			$user->{$this->_field('passwordTokenExpires')} = null;

			return $this->_table->save($user, ['checkRules' => false]);
		}

		return false;
	}
public function resetPassword ( Entity $ user ) { if ( ! $ user -> getErrors ( ) ) { $ user -> { $ this -> _field ( 'password' ) } = $ this -> hashPassword ( $ user -> { $ this -> _field ( 'password' ) } ) ; $ user -> { $ this -> _field ( 'passwordToken' ) } = null ; $ user -> { $ this -> _field ( 'passwordTokenExpires' ) } = null ; return $ this -> _table -> save ( $ user , [ 'checkRules' => false ] ) ; } return false ; }
Password reset, compares the two passwords and saves the new password.

@param \Cake\Datasource\EntityInterface $user Entity object.
@return bool|\Cake\Datasource\EntityInterface
Password reset compares the two passwords and saves the new password .