DB_DataObject joinAdd question
| From: | Ed Greenberg | Date: | Wed, 20 Jul 2005 16:36:35 +0000 |
| Subject: | DB_DataObject joinAdd question | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-20073@lists.php.net to get a copy of this message | ||
Trying to get my use of joinadd correct:
// so I set up my two objects
$dboi = DB_DataObject::factory('item');
$dboc = DB_DataObject::factory('category');
// and join 'em together
$dboi->joinadd($dboc);
// I set up the first two where conditions
$dboi->member_id = $member_id;
$dboi->item_status = 'approved';
// And now I want to select on a column in category.
// I tried $dboi->_dboc->item_class = $item_class
// and a few other permutations, but finally wound up with:
$dboi->whereadd("category.item_class = '$item_class'");
So was there something I could have done other than the whereadd?
Note that I also have
[item]
category_id = category:category_id
in my links file.
Thanks,
</edg>