Re: DB_DataObject_Formbuilder: preventing crossLinks from being deleted
| From: | Justin Patrin | Date: | Mon, 17 Jan 2005 18:13:02 +0000 |
| Subject: | Re: DB_DataObject_Formbuilder: preventing crossLinks from being deleted | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-35541@lists.php.net to get a copy of this message | ||
On Mon, 17 Jan 2005 11:10:40 +0100, Sönke Ruempler
<ruempler@topconcepts.com> wrote:
> Justin Patrin wrote on Friday, January 14, 2005 11:15 PM:
>
> > On Fri, 14 Jan 2005 13:31:00 +0100, Sönke Ruempler
> > <ruempler@topconcepts.com> wrote:
> >> Hi,
> >>
> >> I just ran into a problem with the new crossLink behaviour of
> >> deleting and inserting only old / new entries. The thingy is that my
> >> application also can store data in the crossLink without having set
> >> a "toField" (it's set to NULL in this case) because it has no
> >> relation to the "toTable". These entries are getting deleted
> >> everytime the crossLink is updated. I think this situation could
> >> happen quite often.
> >>
> >> I guess in crossLink processing of the submitted values the $do
> >> should be able to be "callback'ed" in some way before the find() is
> >> done.
> >>
> >> Or better a automagically added whereAdd - dunno if this is
> >> compatible to all DBMS:
> >>
> >> $do->whereAdd($toField . 'IS NOT NULL', 'AND');
> >> $do->find();
> >>
> >> What's your opinion?
> >>
> >
> > Good point. I've added prepareLinkedDataObject support for crossLinks
> > and tripleLinks to FormBuilder in CVS. *This is not tested*. If you
> > could please test and let me know how it works for you I'd appreciate
> > it. See this URL for how this callback is used
> >
> > http://opensource.21st.de/tiki-index.php?page=Callback+methods#id2760
>
> Thank you, Justin.
>
> The $key is undefined.
What are you referring to here?
>
> I'd prefer to automatically add a $toField IS NOT NULL to the crossLink
> where section before find(). That should not void any table layouts.
I'd rather not do this as this really isn't how crosslinks works. If
we make it part of crossLinks to make the field NULL instead of
deleting the record I could see this. We'd need a good reason for
this, though.
>
> But it works with the callback, too. ;-)
>
--
Justin Patrin