[TYPO3-dev] Add data to a remote database

Christian Reiter cr at cNOSPAMxd.de
Tue Jun 10 12:15:23 CEST 2014


Hi,

If the whole thing is event-driven (synchronize when a fe_user is 
created or updated) you can use hooks.

For instance there is a hook called "processDatamap_afterDatabaseOperations"

In your hook code you will need to connect to the remote database. You 
already have all the data in "fieldArray".

You may find that when a new dataset is created it starts out with an ID 
set to "NEWxxxx". If you encounter this you can correct it using the 
"substNEWwithIDs" function. Obviously the real ID is available only 
after insertion into DB.

Obviously this will only work cleanly if fe_users are not added or 
altered in the remote database. Otherwise the new ID you are creating in 
your local database backend may already be occuppied in the remote database.

Otherwise you will be dealing with ID collisions and the whole situation 
gets a lot more complex.

Best regards,

Christian


Am 09.06.2014 11:55, schrieb Thanos:
> I am wondering if it is possible from the backend to insert data to a
> remote database.
> When i create a feuser i want his information to be stored also to
> another database.
> It would be great if the fe_users table could store the id of the
> altered foreign table too.
> I am thinking of a service or an extension with customized TCA that will
> extend the fe_users.
> Any directions of how i can do that with typo3 version > 6
> Thank you very much
>




More information about the TYPO3-dev mailing list