Re: should $object->create() set $object->guid()?
Tarjei Huse <tarjei-y/[email protected]> Fri, 03 Mar 2006 10:23:17 +0100
| Newsgroups | gmane.comp.web.midgard.devel |
|---|---|
| Message-ID | <[email protected]> |
On fre, 2006-03-03 at 10:20 +0100, Piotras wrote: > Tarjei Huse <tarjei-y/[email protected]> wrote: > > > Hi, while debugging It dawned to me that when I create an object using > > the new api, the object's guid will not be set. > > > > I'm wondering: > > a) Is this a bug or a feature? > > b) Is it simple to fix? > > c) Are there technical reasons why the objects guid cannot be updated > > when the id is? > > MgdSchema objects in 1-7 branch are "optimized" for legacy objects and code. > New repligard record is created *after* object's one. This can be "fixed" on any level. > > <?php > if($object->create()) > $object->guid = $object->guid(); > ?> > > In HEAD ( 1.8 ) guid is created before any insert is made. So guid is not related to > some database operation like creating repligard's record but it' related to object's > property which is being set before insert to object's table and repligard is made. > > Did you debug HEAD or stable branch? This was 1.7.4, but the code must work both places. Tarjei. > Piotras > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe-b5ZhpPVuLA+tlBvVaVFjCkB+6BGkLq7r@public.gmane.org > For additional commands, e-mail: [email protected] > -- Tarjei Huse <tarjei-y/[email protected]>