src/Model/Table/UsersTable.php
public function beforeMarshal(Event $event, ArrayObject $data, ArrayObject $options)
    {
        if (isset($data['id'])) {
            // Unset password and password confirmation if password is empty when editing a user.
            if (isset($data['password']) && empty($data['password'])) {
                unset($data['password']);

                if (isset($data['password_confirmation'])) {
                    unset($data['password_confirmation']);
                }
            }
        }
    }
public function beforeMarshal(Event $event, ArrayObject $data, ArrayObject $options)
    {
        if (isset($data['id'])) {
            // Unset password and password confirmation if password is empty when editing a user.
            if (isset($data['password']) && empty($data['password'])) {
                unset($data['password']);

                if (isset($data['password_confirmation'])) {
                    unset($data['password_confirmation']);
                }
            }
        }
    }
public function beforeMarshal ( Event $ event , ArrayObject $ data , ArrayObject $ options ) { if ( isset ( $ data [ 'id' ] ) ) { // Unset password and password confirmation if password is empty when editing a user. if ( isset ( $ data [ 'password' ] ) && empty ( $ data [ 'password' ] ) ) { unset ( $ data [ 'password' ] ) ; if ( isset ( $ data [ 'password_confirmation' ] ) ) { unset ( $ data [ 'password_confirmation' ] ) ; } } } }
Called before request data is converted to an entity.

@param Event $event An event instance.
@param ArrayObject $data The data to marshal.
@param ArrayObject $options Additional options.
@return void
Called before request data is converted to an entity .