[PHP] How can I get a list of object vars?

2007-08-02 Thread js
Hi list. I'm trying to write a ORM in PHP. I want the ORM to have metadata mapping, which have a list of properties name and the value, without using any external file. (I like simple one, not want messy XML) I'm thinking PHP's reflective functions might help me to do that and treid

Re: [PHP] How can I get a list of object vars?

2007-08-02 Thread Robin Vickery
On 02/08/07, js [EMAIL PROTECTED] wrote: Hi list. I'm trying to write a ORM in PHP. I want the ORM to have metadata mapping, which have a list of properties name and the value, without using any external file. (I like simple one, not want messy XML) I'm thinking PHP's reflective

Re: [PHP] How can I get a list of object vars?

2007-08-02 Thread Nathan Nobbe
On 8/2/07, js [EMAIL PROTECTED] wrote: you may need to work with the reflective functions for a while to get them down. if you want to see some usage of them, check out PHPUnithttp://www.phpunit.de/ . Robin Vickery wrote: $properties = (array) $myObject; no? no, thats why there are

Re: [PHP] How can I get a list of object vars?

2007-08-02 Thread js
Thank you, it worked, but it contains some dust. Is it possible to remove the dust? ?php class Obj { private $priv; public $pub; protected $prot = 'foo'; } $obj = new Obj(); $obj-more_var = 'val'; foreach ((array)$obj as $k = $v) echo $k = $v\n; ? -- PHP General Mailing List

Re: [PHP] How can I get a list of object vars?

2007-08-02 Thread Nathan Nobbe
i think you misunderstood me; i was recommending you NOT use the array cast of an object to accomplish your task. rather, i would advise you spend time learning the reflection API because its designed for retrieval of information about classes and functions, etc.. apparently the array cast method