| Justin Patrin 2005-07-24, 8:39 pm |
| On 7/20/05, Ed Greenberg <edg@greenberg.org> wrote:
> Trying to get my use of joinadd correct:
>=20
> // so I set up my two objects
> $dboi =3D DB_DataObject::factory('item');
> $dboc =3D DB_DataObject::factory('category');
>=20
> // and join 'em together
>=20
> $dboi->joinadd($dboc);
>=20
> // I set up the first two where conditions
> $dboi->member_id =3D $member_id;
> $dboi->item_status =3D 'approved';
>=20
> // And now I want to select on a column in category.
> // I tried $dboi->_dboc->item_class =3D $item_class
> // and a few other permutations, but finally wound up with:
>=20
> $dboi->whereadd("category.item_class =3D '$item_c=
lass'");
>=20
> So was there something I could have done other than the whereadd?
>=20
> Note that I also have
> [item]
> category_id =3D category:category_id
>=20
> in my links file.
>=20
You're missing the simplest possibility which is:
$dboc->category_id =3D $item_class;
I suggest you put this before the joinAdd call as I'm not sure if the
DO is passed by-ref or not.
--=20
Justin Patrin
|