⚠ 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

Two different functions on callback_after_insert()



T.O.M.
  • profile picture
  • Member

Posted 03 April 2015 - 13:26 PM

Hi guys!

I have a question.
Is there any possible to set in callback_after_insert two different functions?
It would be great something like:

callback_after_insert(array($this, 'function1'));
callback_after_insert(array($this, 'function2'));

But the first function is not working. Single function (first or second) is working, but two functions are not.


voghDev
  • profile picture
  • Member

Posted 03 April 2015 - 14:01 PM

I'm afraid that function2 rewrites function1.

 

Can't you use a single function (function2), and call function1 inside it?


T.O.M.
  • profile picture
  • Member

Posted 03 April 2015 - 14:06 PM

I thought so. It's bad :(
Will have to do it somehow.
Thanks.


maxmax
  • profile picture
  • Member

Posted 03 April 2015 - 16:34 PM

What's the point to call two different functions with the same arguments, one after another ?

If you want to split the logic to reuse it, why don't you do what voghDev suggests ?