I have this object which i have displayed below with print_r() function. I want to know how do i access accessToken member. I have tried this method too.. $client->{'authrotected'}->accessToken .. But this doesnt work. apiClient Object ( [auth:protected] => apiOAuth2 Object ( [developerKey] => AIeweweqewLQLWBk6lVgqzZREg9kao8yMiMBk [accessToken] => Array ( [access_token] => ywewewewewgaSq57TkcEjMupRR6R8 [token_type] => Bearer [expires_in] => 3600 [refresh_token] => 1e/PY0xzzwikY [created] => 1315841905 ) [io] => apiCurlIO Object ( [cache:private] => apiFileCache Object ( [path:private] => /tmp/apiClient ) [auth:private] => apiOAuth2 Object *RECURSION* ) ) [io:protected] => apiCurlIO Object ( [cache:private] => apiFileCache Object ( [path:private] => /tmp/apiClient ) [auth:private] => apiOAuth2 Object ( [developerKey] => AIzaSyB2qma_LQLWBk6lVgqzZREg9kao8yMiMBk [accessToken] => Array ( [access_token] => ywewewewewgaSq57TkcEjMupRR6R8 [token_type] => Bearer [expires_in] => 3600 [refresh_token] => 1e/PY0xzzwikY [created] => 1315841905 ) [io] => apiCurlIO Object *RECURSION* ) ) ) Code (markup):
You need to create a public method to return the accessToken, or modify the class and make accessToken public. Just looking at the code, why would you need to publicly access accessToken? It seems like it should be protected or private for security's sake.