src/Controller/Component/UserToolComponent.php
public function requestPassword($options = []) {
		$options = Hash::merge($this->getConfig('requestPassword'), $options);
		$entity = $this->UserTable->newEntity(null, [
			'validate' => 'requestPassword'
		]);

		if ($this->_getRequest()->is('post')) {
			$entity = $this->UserTable->patchEntity($entity, $this->_getRequest()->getData(), [
				'validate' => 'requestPassword'
			]);

			if (!$entity->errors($options['field']) && $this->_initPasswordReset($entity, $options)) {
				return true;
			}

			if ($options['setEntity']) {
				if ($entity->dirty('email') && !$entity->errors('email')) {
					$entity->email = '';
				}
				$this->_setViewVar('userEntity', $entity);
			}
			unset($this->_getRequest()->data[$options['field']]);

			return false;
		}

		if ($options['setEntity']) {
			$this->getController()->set('userEntity', $entity);
		}
	}
public function requestPassword($options = []) {
		$options = Hash::merge($this->getConfig('requestPassword'), $options);
		$entity = $this->UserTable->newEntity(null, [
			'validate' => 'requestPassword'
		]);

		if ($this->_getRequest()->is('post')) {
			$entity = $this->UserTable->patchEntity($entity, $this->_getRequest()->getData(), [
				'validate' => 'requestPassword'
			]);

			if (!$entity->errors($options['field']) && $this->_initPasswordReset($entity, $options)) {
				return true;
			}

			if ($options['setEntity']) {
				if ($entity->dirty('email') && !$entity->errors('email')) {
					$entity->email = '';
				}
				$this->_setViewVar('userEntity', $entity);
			}
			unset($this->_getRequest()->data[$options['field']]);

			return false;
		}

		if ($options['setEntity']) {
			$this->getController()->set('userEntity', $entity);
		}
	}
public function requestPassword ( $ options = [ ] ) { $ options = Hash :: merge ( $ this -> getConfig ( 'requestPassword' ) , $ options ) ; $ entity = $ this -> UserTable -> newEntity ( null , [ 'validate' => 'requestPassword' ] ) ; if ( $ this -> _getRequest ( ) -> is ( 'post' ) ) { $ entity = $ this -> UserTable -> patchEntity ( $ entity , $ this -> _getRequest ( ) -> getData ( ) , [ 'validate' => 'requestPassword' ] ) ; if ( ! $ entity -> errors ( $ options [ 'field' ] ) && $ this -> _initPasswordReset ( $ entity , $ options ) ) { return true ; } if ( $ options [ 'setEntity' ] ) { if ( $ entity -> dirty ( 'email' ) && ! $ entity -> errors ( 'email' ) ) { $ entity -> email = '' ; } $ this -> _setViewVar ( 'userEntity' , $ entity ) ; } unset ( $ this -> _getRequest ( ) -> data [ $ options [ 'field' ] ] ) ; return false ; } if ( $ options [ 'setEntity' ] ) { $ this -> getController ( ) -> set ( 'userEntity' , $ entity ) ; } }
The user can request a new password reset token, an email is send to him.

@param array $options Options
@throws \Cake\Datasource\Exception\RecordNotFoundException
@return bool|null
The user can request a new password reset token an email is send to him .