updatePersonalData

The updatePersonalData hook is triggered after a member has updated his personal data. It passes the front end user, the updated data and the front end module and does not expect a return value.

Be aware that the front end user object and the database has already been updated when this hook is triggered.

Parameters

  1. \Contao\FrontendUser $member

    The front end user instance who changed his data.

  2. array $data

    The submitted form data.

  3. \Contao\Module $module

    The front end module of type \Contao\ModulePersonalData.

Example

// src/EventListener/UpdatePersonalDataListener.php
namespace App\EventListener;

use Contao\CoreBundle\ServiceAnnotation\Hook;
use Contao\Module;
use Contao\FrontendUser;
use Terminal42\ServiceAnnotationBundle\ServiceAnnotationInterface;

class UpdatePersonalDataListener implements ServiceAnnotationInterface
{
    /**
     * @Hook("updatePersonalData")
     */
    public function onUpdatePersonalData(FrontendUser $member, array $data, Module $module): void
    {
        // Do something …
    }
}

References