Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getResponseJSON for single record #10

Open
ibmgeniuz opened this issue Jan 13, 2021 · 0 comments
Open

getResponseJSON for single record #10

ibmgeniuz opened this issue Jan 13, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@ibmgeniuz
Copy link
Contributor

Hello,
Thanks for the package. It really helps with my work. I realized that I could use for eg:

$contacts = ZohoManager::useModule('Contacts');
$contacts->getRecord($record_id)->getData();

This works well, however, if there are nested data, they are ignored and returned as

{
    ...
    "Nested_Item": {} 
}

NB: Though Nested_Item shows empty, it actually has data in it.

I think it is because the response ignores arrays in the array. I couldn't loop through with for each because the empty Nested_Item is also returned as a ZCRMRecord. I thought looping through and doing getData() on it was going to expand that, but nothing. I think the getResponseJSON() does this out of the box.

If you use eg:

$related = $record->getRelatedListRecords('deals');

You can then use

$related->getResponseJSON();

It returns

{
    ...
    "Nested_Item_With_Data": {
             data: {...}
      }
}

Is it possible to have such a response for getting a single item or if it already exists, can you please point me in the right direction?

Thanks in advance

@aemaddin aemaddin added the enhancement New feature or request label Jan 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants