Taking part in the frontend user synchronisation
The commands
academic: and
academic: build profiles from the data of frontend
users, following the map described in Frontend user synchronisation.
Two events let a project add data of its own and adjust the result, without a
profile factory of its own.
Abstract dispatches them, so
every factory extending it does, a project's factory included, unless it
overrides
create or
update
without calling the parent method.
| Event | Dispatched | A listener can |
|---|---|---|
| BeforeProfileMappedFromFrontendUserEvent | before the data of a frontend user is mapped: once per frontend
user when a profile is created, and once per synchronised profile
of the frontend user when profiles are updated, not for a profile
whose
skip_ flag is set | add or change values, or skip the frontend user on creation and the profile on update |
| AfterProfileMappedFromFrontendUserEvent | after the mapping, before the profile is saved | change the profile |
For one frontend user, a run goes through these steps:
- ChooseProfileFactoryEvent chooses the factory.
Beforecarries the data of the frontend user, the action (Profile Mapped From Frontend User Event ProfileorAction Type:: Create Profile) and, on update, the profile.Action Type:: Update getisProfile () nullwhen a profile is created.- The factory maps the data onto the profile and its imported contract.
Aftercarries the profile, the data the mapping used, with the values added in step 2, and the action.Profile Mapped From Frontend User Event - The profile is saved, and AfterProfileUpdateEvent announces it, see AfterProfileUpdateEvent.
On update, steps 2 to 4 repeat for every synchronised profile of the frontend user, and step 5 then saves and announces them together. Each event of step 2 starts from the data of the frontend user, not from what a listener set for the profile before.
Listeners of one event are ordered with the
before
and
after
arguments of
#. Use TYPO3's attribute,
\TYPO3\: Symfony's registers nothing,
and the listener never runs.
A factory of its own may decline to create a profile, see Custom profile factories.
The commands also dispatch
\FGTCLB\
before they set up the environment of a frontend user's site. It is marked
@internal
as experimental, like the environment handling it belongs
to, and is not documented here.