Re: should $object->create() set $object->guid()?
Piotras <pp-VVDi8QVAvoBWk0Htik3J/[email protected]> Fri, 3 Mar 2006 10:20:10 +0100
| Newsgroups | gmane.comp.web.midgard.devel |
|---|---|
| Message-ID | <[email protected]> |
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? Piotras