aviel Posted September 19, 2015 Share Posted September 19, 2015 Hello everyone, this is my first post. Basically I need some help to understand the order in which methods are executed when I create a new module starting from here. I have my known method renderForm() which display the form to create a new Object ( Product ). I send the form and magically the object is saved into DB. First question. ¿Which method is executed to save the object? I need to know this, because i have related values to my object, and i have a new function to save that values. If i add the validation in postProcess() i can get values sent from my form and manipulate them, but i don't want to use an manual INSERT, i want to keep the normal Prestashop process and after object is created, call my additional method for additional values. I hope the explanation is clear, and any comments will be really appreciated. Thanks in advance! Link to comment Share on other sites More sharing options...
bellini13 Posted September 19, 2015 Share Posted September 19, 2015 review the ObjectModel class. All object classes (Product, Address, Customer etc...) extend the ObjectModel which handles the 'magic' Link to comment Share on other sites More sharing options...
aviel Posted September 19, 2015 Author Share Posted September 19, 2015 Thanks bellini13, i understand that magic. What i do not know is where is a callback or something to execute another method after object is created. If you see this Class, there is a method processFeatures() used to dd related info. But Where is the method call? https://github.com/jdanthinne/advancedfeaturesvalues/blob/master/override/controllers/admin/AdminProductsController.php Thanks in advance. Link to comment Share on other sites More sharing options...
bellini13 Posted September 20, 2015 Share Posted September 20, 2015 As I said, review the ObjectModel. There is a function called "add", and at the very beginning of that function are two hooks // @hook actionObject*AddBefore Hook::exec('actionObjectAddBefore', array('object' => $this)); Hook::exec('actionObject'.get_class($this).'AddBefore', array('object' => $this)); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now