Hi
I'm currently trying to extend the Midgard Classes with custom
functionality. The basic Idea is to take a standard Midgard Class, put
some of your own stuff to it and rely on the basic infrastructure of
midgard to do all the basic things, only writing code where the custom
things start
What I've tried looks something like this:
1 : class CBenutzer extends MidgardPerson {
2 : var $__test;
3 :
4 : function CBenutzer ($id) {
5 : $user = mgd_get_person ($id);
6 :
7 : // Do some checks here wether the person is OK
8 :
9 : $this = $user;
10 :
11 : }
12 :
13 : }
Line 9 throws everything apart, which is logical after I have thought
about it. PHP transforms the whole $this object into a Midgard Person,
makeing the whole thing broken. Now I didn't found some way of
initializing MidgardPerson by a (copy)constructor or anything similar
which would allow me to do the above within a single function call instead
of having to do a whole lot of $this->name = $user->name lines for every
variable.
Do the Midgard Objects provide any way of initializing an object without
having to use the mgd_get_person (or whatever) strategy, perhaps an
$this->init($id) or so?
Live long and prosper!
Torben Nehmer
--
ICQ-ID : 14148813 --- E-Mail : [EMAIL PROTECTED]
WWW : http://www.nathan-syntronics.de --- http://www.nehmer.net
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]