⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

2 callbacks after insert/update possible?



Ruedische
  • profile picture
  • Member

Posted 22 April 2012 - 09:58 AM

I need two callback-actions after insert or update data. In my tests only one is executed. Maybe, I don't know how to write it. Both functions are working, but I can call only one of them at the same time. Isn't it possible? Or am I too tired to write proper code? ;)

Ruedische
  • profile picture
  • Member

Posted 22 April 2012 - 10:29 AM

Ad hoc solution: I've merge the two functions into one. This is not very readable, but working.

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 22 April 2012 - 10:51 AM

You can simply do something like this:


function callback_1($post_array,$primary_key) {
//Your code here
$this->callback_2($post_array,$primary_key);
$this->callback_3($post_array,$primary_key);
return true;
}


or something similar to this.