Re: DB_DataObject->joinAdd
| From: | Noel da Costa | Date: | Wed, 26 Jul 2006 08:34:49 +0000 |
| Subject: | Re: DB_DataObject->joinAdd | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-24768@lists.php.net to get a copy of this message | ||
Thanks for the link.
It looks like you are passing in a DataObject as the first argument of the joinAdd(), which is how the documentation on the PEAR site says it should be done - however, that requires a correctly configured links.ini file... I'm actually looking at a way of doing this that doesn't require a working links.ini file.
My reason for this is that I have a custom DataObjects generator script that works in a different way to the link.ini file (more efficient for RAD in my case).. so I'm hoping that there is a way to set the table part of the foreign field name explicitly without having to pass a dataObject to joinAdd.
Thanks,
Noel
On 26 Jul 2006, at 09:23, Ian Warner wrote:
Hi at the bottom of this page is a join example that may help you. http://wiki.triangle-solutions.com/index.php/PEAR_DB_DataObject Regards Ian Warner Director Triangle Solutions Ltd http://www.triangle-solutions.com/ Noel da Costa wrote:Hi there, I'm using this syntax for joinAdd: $dataObject =& DB_DataObject::factory('person'); $foreignTable = 'role'; $foreignColumn = 'role_id'; $dataObject->joinAdd(array($key,$foreignTable.':'.$foreignColumn)); which gives the following SQL: JOIN role ON role.role_id=person.role_id I'm trying (and failing) to change the "person." part before the last "role_id" I need this to match a different table (personrole), rather than the primary (person) table. How do I make this change within the systax for joinAdd? Thanks, Noel da Costa Lead Developer www.magharl.co.uk--PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ___________________________________________________________________ This message has been scanned by the Datanet MessageScreen Service. For more information please visit http://www.MessageScreen.co.uk