Re: Sitegroup issue!
Tarjei Huse <tarjei-y/[email protected]> Tue, 07 Mar 2006 19:24:00 +0100
| Newsgroups | gmane.comp.web.midgard.devel |
|---|---|
| Message-ID | <[email protected]> |
Jukka Zitting wrote: > Hi, > > On 3/7/06, Tarjei Huse <tarjei-y/[email protected]> wrote: >> This is partly a chicken and egg problem. I need this to create >> sitegroups and hosts. Having a setsitegroup operation is a lot better >> than debugging strange errors in mgd_auth_midgard(). > > Ah, your use case is different from the general update(). Do you mean > something like this: > > $object = new someobject(); > $object->sitegroup = $sitegroup; > $object->create(); > > The create() case is a lot easier as there is no chance of breaking > existing objects (nothing can link to an unexisting object). Well, that does not work today so no code uses that method :-) Wrt to sitegroup management, I can see a lot of good uses for setsitegroup() - I think we need functionality like it, at least until we get proper acls in core. If the ->sitegroup attribute is hard to manage, then I suggest we remove it from 1.8 and instead get a setsitegroup() method that works. As an added bonus, this is BC as well. My main issue at the moment is getting a release of Midgard where the API is stable, consistent and working. Do you have any input on how we can achieve that? Tarjei >>> It would be possible if we defined the generic Zend getter and setter >>> methods instead of copying property values back and forth from >>> MgdSchema object properties to PHP object properties... >> I guess that would imply $obj->get('att') ? > > Not necessarily. Zend allows the registration of special > handle_overload_{get,set} handlers for internal classes. See the PHP4 > overload extension (http://www.php.net/manual/en/ref.overload.php) for > an idea of how this works. > > BR, > > Jukka Zitting > > -- > Yukatan - http://yukatan.fi/ - [email protected] > Software craftsmanship, JCR consulting, and Java development