src/Model/Behavior/UserBehavior.php
public function changePassword(EntityInterface $entity, array $options = []) {
		$options = Hash::merge($this->_config['changePassword'], $options);

		if ($entity->getErrors()) {
			return false;
		}

		if ($options['hashPassword'] === true) {
			$field = $this->_field('password');
			$entity->set($field, $this->hashPassword($entity->get($field)));
		}

		return (bool)$this->_table->save($entity);
	}
public function changePassword(EntityInterface $entity, array $options = []) {
		$options = Hash::merge($this->_config['changePassword'], $options);

		if ($entity->getErrors()) {
			return false;
		}

		if ($options['hashPassword'] === true) {
			$field = $this->_field('password');
			$entity->set($field, $this->hashPassword($entity->get($field)));
		}

		return (bool)$this->_table->save($entity);
	}
public function changePassword ( EntityInterface $ entity , array $ options = [ ] ) { $ options = Hash :: merge ( $ this -> _config [ 'changePassword' ] , $ options ) ; if ( $ entity -> getErrors ( ) ) { return false ; } if ( $ options [ 'hashPassword' ] === true ) { $ field = $ this -> _field ( 'password' ) ; $ entity -> set ( $ field , $ this -> hashPassword ( $ entity -> get ( $ field ) ) ) ; } return ( bool ) $ this -> _table -> save ( $ entity ) ; }
Changes the password for an user.

@param \Cake\Datasource\EntityInterface $entity User entity
@param array $options Options
@return bool
Changes the password for an user .