Re: DB_DataObject::joinAdd issue

From: Date: Sat, 18 Jan 2003 20:54:48 +0000
Subject: Re: DB_DataObject::joinAdd issue
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-3340@lists.php.net to get a copy of this message
Alan Knowles wrote:
had a quick look at this, you are probably best adding $run->selectAdd('tTrain.id as tTrain_id, tSchedRun.id as tSchedRun_id');
I don't think this will work, as the find() is applied to the train object. I don't recall the selectAdd of the object to be joined is added to to the object joined upon. You might try $train->selectAdd('tTrain.id as tTrain_id, tSchedRun.id as tSchedRun_id'); This should work, but I don't know if this is a nice implementation. Maybe joinAdd() should import the select conditions set in the joined object. Alan, a word from you about this? I can work on it the next couple of days if you like. I'm using the same sort of thing for my own code, but I don't recall having problems with the 2 'id' columns, I'll look into it... Also, I noticed that addJoin() is still using the addslashes() function, instead of the $__DB->quote() method, I'll apply a patch shortly. Stijn
I'm reluctant to add to much magic behind the scenes here, as doing join is confusing enough without adding to much unexpected behavour.. Regards Alan


« previous php.pear.general (#3340) next »