You are not logged in.
Hi,
I am trying to figure out how a plugin can retrieve calculated values from the core.
In my case I want to extend the Order plugin to show a "budget preview". That is: What would the total amount spent on a budget look like, after the pending orders have been processed.
For this I need the Order plugin to know the total value already spent on the budget. Which is a value that is calculated in core class Budget, function showValuesByEntity(). But how can the plugin receive this value?
(I cound reproduce the calculate logic within the plugin code, but that would result in duplicate code. Seems to be very bad programming style to me.)
Shoud I extend the core class Budget? By adding an additional function, like "getTotalAmountSpent()"? Would such a modification of a core class be ever accepted in the official codebase, anyway?
Or do I miss something, and there ist already a way of getting this value from the core?
Offline