On Thu, 02 May 2002 10:03:01 +0200 Torben Nehmer wrote:

> A PHP-like approach using
> something like
>
>   $variables = get_object_vars($object);
>   foreach($variables as $var => $data)
>     $this->$var = $data;
>
> does not always work cleanly, you can get errors due to missing
> variables which are very hard to trace, believe me...

I performed an extended experiment investigating the properties (and
methods) of Midgard objects. The results are somewhat confusing:

(1)
Any mgd_..._list_... function delivers "truncated" object which lacks MOST
of the members the normal corresponding object obtained with mgd_get_...
has.
It has only __table__, id and sitegroup as its members (in common with a
normal object ;-)

(2)
Any mgd_..._list_... function delivers an object with TWO EXTRA members: N
and __res__.

(3)
Any unset object property can't be obtained with

get_object_vars($object);

as Torben has noted - in full compliance with PHP manual.

(4)
Any object obtained with mgd_get_... has all its *Midgard properties* as the
members :-(

(5)
The lists of methods for both kinds of Midgard objects (list and get)
coincide. I wonder what does fetch() fetch for the object obtained with
"get" - sorry, I didn't try it - probably, it'll return false.

(6)
Any object has a single method, which isn't described in the Manual (among
other methods). Its name starts with "midgard", but the tail of the name can
have spaces and quotes in it:

midgardtopic
midgardarticle
midgardgroup

But:

midgard "event"
midgard "event_member"
midgard "person"

I wonder: can one make any use of this method(s)?

A synopsis:

Torben is right. The OOP life with Midgard is somewhat more tough than one
could expect.
Praemonitus -- praemunitus.Thanks, Torben.

/Victor


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to