Re: Structures_DataGrid, automatic DB_DataObject joinAdd experiment
| From: | Justin Patrin | Date: | Tue, 02 Jan 2007 04:07:27 +0000 |
| Subject: | Re: Structures_DataGrid, automatic DB_DataObject joinAdd experiment | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-26239@lists.php.net to get a copy of this message | ||
If you're nesting links then you need to nest you joinAdd calls.
$b->joinAdd($c);
$a->joinAdd($b);
$a->find() && $a->fetch();
At least, this is how it works with DO objects. The reason this is
failing for you is because a does not join with a, it joins with b.
On 12/30/06, arnaud sellenet <demental@free.fr> wrote:
Sorry for the double(triple?) post, my message never came back to me so I thought it was rejected or lost or something. I've written a quick example here : http://demental.info/pear_exp/ in case it could clarify. Is there any test suite for DB_DataObject ? Because commenting from line 3091 to 3099 DataObject.php-- Justin Patrinif ($joinCol !== false) { $this->raiseError( "joinAdd: You cannot target a joincolumn in the " ."'link from' table ({$obj->__table}). " . "Either remove the fourth argument tojoinAdd() "."({$joinCol}), or alter your links.inifile.",DB_DATAOBJECT_ERROR_NODATA); return false; }makes me get rid of this problem. But I'm not sure about the side effects. Le 30 déc. 06 à 02:20, Olivier Guilyardi a écrit : Hi Arnaud, Please don't post the same message several times. arnaud sellenet a écrit :That looks interesting, but complex too. Could you please give an example of what you are trying to achieve?I'm trying to make a DB_DataObject driver for Structures_DataGrid that aims to handle links and automatically do a joined query using joinAdd (see http://hashbin.com/114.html for source code). The joinAdd are created in the bind() method.This works fine except for nested links. my links.ini : [envoi_campagne] mail_id = addressbook:id campagne_id = campagne:id relance_id = envoi_campagne:idAnd here is the debug output :Thanks DB_DataObject we have a meaningful and precise error message. So I think you should first try and solve this. Unfortunately I'm no expert when it comes to DB_DataObject and joins. Could anyone on the list help Arnaud with this error message? Regards, -- Olivier -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpDataObjects_Envoi_campagne: ERROR: joinAdd: You cannot target a join column in the 'link from' table (envoi_campagne). Either remove the fourth argument to joinAdd() (relance_id), or alter your links.ini file.