Page 1 of 1

how to get private properties of an object

Posted: Wed Feb 08, 2012 1:07 pm
by kc11
Hi ,

I am trying to access a private property of and object, but can't get it working. Here is the schema of the object from a var_dump:

[text]
object(RedBean_OODBBean)[34]
private 'null' => null
private 'properties' =>
array
'id' => int 0
'type' => string 'http://xxxxxx
'map' => string 'http://yyyyy

[/text]

how would I get access to for example - id

Thanks in advance,

KC

Re: how to get private properties of an object

Posted: Wed Feb 08, 2012 3:24 pm
by social_experiment
Have you tried $this->properties[0] ?

Re: how to get private properties of an object

Posted: Thu Feb 09, 2012 8:53 am
by kc11
Thanks for looking at it social_experiment,

I added the following code:

Code: Select all

$bean_props=$table1->properties[0] ; // table 1 is my object name
var_dump($bean_props);
Unfortunately, my output is null.

I think this may have something to do with the scope of accessing private object data