how to hadle response of getPlans()?
how to hadle response of getPlans()?
-
Untitled.png 20.9 KB
Discussions are closed to public comments.
If you need help with Cheddar please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Marc Guyer on Nov 12, 2014 @ 02:35 PM
Hi Ryan -- This depends on what you want to do. It looks like you just want to get one plan...
Your call to
$response = $client->getPlan()
will return a CheddarGetter_Response object which is a DOMDocument. You can do whatever you want to that using the DOM. Or, you can get an array representation with the getPlan() method of CheddarGetter_Response. You could actually do that in one line:In that example, you're explicitly asking the API to return one plan, then convert that plan to an array.
Or, you could get all the plans and then extract just the one you want:
In that example, you're asking the API for all of the plans, then using the getPlan() method of the response object to extract just the one plan.
Marcela Poffald closed this discussion on Apr 11, 2018 @ 03:55 PM.