Importing (and creating) data for more than one table
I'm trying to import data, but in the end I want to insert into more than one table.
Problem details:
My idea was to create teachers (and link them to a user) within thebut this does not seem to work.
In fact the hooks doesn't seem to fire at all.
Currently I have:
Is there a better approach here?I'm I missing something?
Any help would be appreciated.
Problem details:
- I have a
userstable. - I have a
teacherstable. - The import should add users to the
userstable but it should also create teachers (for new users) for each user
->relationship() helper won't work because I don't have existing teachers to match to users.My idea was to create teachers (and link them to a user) within the
->afterCreate() or ->afterSave() lifecycle hooks Currently I have:
Is there a better approach here?
Any help would be appreciated.