-
Notifications
You must be signed in to change notification settings - Fork 7
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
Getting value of particular array-key(protected) from response object? #3
Comments
In this case "$response" contains a collection (array), so you just need to traverse it using foreach: foreach ($response as $item) {
// Get the name with: $item->getTaskseries()->getName();
} |
Thanks.That worked. But in real response object, I can get foreach ($response as $item) {
$ts = $item->getTaskseries();
foreach ($ts as $item2) {
$name[] = $item2->getName();
}
}
print_r($name[0]); |
Yeah, you can be right here. It all depends on the structure of data returned by Remember The Milk API. This library just wraps the response with an object. For more info on the data structure, please refer to the RTM API methods documentation (https://www.rememberthemilk.com/services/api/methods/). |
This is the sample code I used....to get a particular task list:
And this the sample response I am getting:
I want to extract the value of
[name]
. How can I do it?$response->getTaskSeries()->getName()
does not work.I guess this type of serialization has already been implemented inside the class.
The text was updated successfully, but these errors were encountered: