[Vtigercrm-developers] accessing line items in the save events

Alan Bell alan.bell at libertus.co.uk
Tue Apr 10 14:48:12 PDT 2012


On 10/04/12 15:18, Adam Heinz wrote:
> 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>
> _______________________________________________
> http://www.vtiger.com/
that is great, thanks, I was looking at $_REQUEST the wrong way (trying 
to write print_r($_REQUEST) to the logfile and not realising it was 
going to stdout) and it was there the whole time waiting for me to use it!

Thanks,

Alan.

-- 
Libertus Solutions http://libertus.co.uk



More information about the vtigercrm-developers mailing list