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
how to get private properties of an object
Moderator: General Moderators
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: how to get private properties of an object
Have you tried $this->properties[0] ?
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Re: how to get private properties of an object
Thanks for looking at it social_experiment,
I added the following code:
Unfortunately, my output is null.
I think this may have something to do with the scope of accessing private object data
I added the following code:
Code: Select all
$bean_props=$table1->properties[0] ; // table 1 is my object name
var_dump($bean_props);
I think this may have something to do with the scope of accessing private object data