RE: [PEAR-DEV] DB_DataObject_Formbuilder: preventing crossLinks from being deleted
| From: | Sönke Ruempler | Date: | Mon, 17 Jan 2005 10:10:40 +0000 |
| Subject: | RE: [PEAR-DEV] DB_DataObject_Formbuilder: preventing crossLinks from being deleted | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-35530@lists.php.net to get a copy of this message | ||
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.
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.
But it works with the callback, too. ;-)