1

I am writing a Joomla 3 component and new to the Joomla framework. I need to insert data into two tables. the logic follows

  1. insert form data into table after submit
  2. retrieve data for next insert ( i can do this and i have the data array )
  3. insert data from array into second table with the PK of the first insert from step 1.These tables are related by 1-M
  4. return the user back to where they came from with success.

I think i have to override the save method in my model to do this but i don't understand how to get the pk of the first save to use with the 2nd

Due to my lack of understanding I am not sure of best practice in this situation.

after reading there is a postSaveHook() method but I am do not understand how to access the data as it returns void

If i copy the Joomla parent save Method and override in the model it will return Boolean therefore i don't no how to access the last PK from the first insert / save.

thanks in advance for any advice.

user1899802
  • 125
  • 1
  • 4
  • 12

0 Answers0