Where is the function getTotal() declared?
This question is related to another question of mine.
I see that the function getTotal() is used in many places including classes/XLite/View/Minicart.php, but the only place where I found it declared so far is classes/XLite/Module/CDev/XPaymentsConnector/Model/Order.php. I suppose I am missing something, but where? |
Re: Where is the function getTotal() declared?
When re-deploying, X-Cart 5.2.x auto-generates get* and set* methods for model properties. getTotal() translates to $this->total. You won't find these methods in the classes/ directory, but you will find them in the var/run/classes directory.
However, the upcoming X-Cart 5.3 won't autogenerate these methods anymore, so module authors will have to declare them manually. |
Re: Where is the function getTotal() declared?
Thank you very much, I went through /var/run/classes, but I couldn't find where total() was declared. It would be nice if there were a documentation in KB that deals with this kind of thing. Anyway, would anyone know where I can find the function total() is declared?
|
Re: Where is the function getTotal() declared?
There is no function "total". "Total" is a field in table. When the object is built XC automatically creates getTotal and setTotal functions to read/write in this field.
So if you have TableA and field in it called "total" $TableA->total; $TableA->getTotal(); $tableA->setTotal(); all work with the field "total" from table "TableA" |
Re: Where is the function getTotal() declared?
Thank you very much, this is now clear.
|
All times are GMT -8. The time now is 07:00 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.