This method is used for one simple purpose: to convert a text-typed values to the corresponding objects, if necessary. Typically, these objects are serialized data, such as conditions or actions or fields that store the date (as a string).
If you do not do this conversion, then in the model the date field will be represented exclusively in text form (as a string), and some methods will not be able to work with it correctly, because expect not the text but the date object.
If you have any data that can be submitted as text and sent through a form, you can also add their conversion in this method, and you can be sure that they will always be presented in the desired form (as an object).
Conditions as an array when form was submitted (in controller, before the
to_date (in controller, before the
_convertFlatToRecursive() in the
as you can see format is different.
Conditions inside the object (rule) before they was set:
Conditions inside the object (rule) after they was set:
as you can see, it's completely working object with own data and methods, is not just array.
Date field after the
loadPost(), it is
So, in case you want to work with a rule-model somewhere in the
afterSave method or in observer you can use this objects and should not worry about "How should I convert these values?".