[Vtigercrm-developers] accessing line items in the save events
Adam Heinz
amh at metricwise.net
Tue Apr 10 07:18:14 PDT 2012
On Tue, Apr 10, 2012 at 9:30 AM, Alan Bell <alan.bell at libertus.co.uk> wrote:
> Is it possible to get access to the $_REQUEST or some other way to see
> the line items on a sales order that is being saved?
$_REQUEST is a PHP superglobal; you always have access to it.
<soapbox>
TLDR: You can do what you need to with $_REQUEST, but may incur technical debt.
That said, one problem I periodically run into is that encapsulation
is repeatedly broken whenever you are forced to look at globals
instead of function arguments. I have at least one place in my code
where I hack the $_REQUEST variable to get the desired behavior.
$reqfoo = $_REQUEST['foo']
$_REQUEST['foo'] = 'bar';
do_something();
$_REQUEST['foo'] = $reqfoo;
do_something_else();
</soapbox>
More information about the vtigercrm-developers
mailing list