I'm using the PHP SDK to connect to the Zoho CRM API to retrieve Quote data.
Within the data returned are details of the quote owner ("Owner") and products ("Product_Details").
On the production version, the Owner and Product_Details are arrays so I can use:
- $userID= $quoteData['Owner']['id];
- foreach ($quoteData['Product_Details'] as $pd) {
- $prodIDs[] = $pd['product']['id'];
- }
However, if I switch to sandbox, which is a clone of the production I get errors such as:
- Cannot use object of type com\zoho\crm\api\record\InventoryLineItems as array
So the code has to be rewritten as:
- $owner=$quoteData['Owner'];
- $userID= $owner->getID();
- foreach ($quoteData['Product_Details'] as $pd) {
- $pdProd=$pd->getProduct();
- $prodIDs[] = $pdProd->getID();
- }
This then works on Sandbox but not Production.
Is there a setting somewhere that I am missing which switches objects to arrays or vice versa. I don't mind which is correct, but it needs to be consistent on both Prod and Sandbox.
Thanks
Andy