My Call gets back: print_r($response)
GetItemResponseType Object
(
[Item:protected] => ItemType Object
(
[ApplicationData:protected] => 651034.9.3011
[BuyerProtection:protected] => ItemEligible
[BuyItNowPrice:protected] => AmountType Object
(
[attributeValues] => Array
(
[currencyID] => EUR
)
[value:protected] => 0.0
)
[Country:protected] => DE
)
)
I read this (How to get protected property of object in PHP), but I can’t reproduce the solution.
How can I get the value of Country with i.e. this:
function accessProtected($obj, $prop) {
$reflection = new ReflectionClass($obj);
$property = $reflection->getProperty($prop);
$property->setAccessible(true);
return $property->getValue($obj);
}
I get nothing, if I call:
echo accessProtected($response, 'Country');
Regards, Matthias
2
Answers
the answer to my question is:
Thank You.
You should create getter and setter functions which are public or static in your class.