Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

DataObject::get Many_Many


Reply


938 Views

Avatar
Cy

Community Member, 11 Posts

23 October 2008 at 8:01pm

I am getting a "Bad class to singleton() - Listing_PropertyTypes" error. The Listing and PropertyType objects have a many to many relationship.

function ListingsByType() {
$where = "PropertyTypeID = 1";
}
return DataObject::get("Listing_PropertyTypes", $where);
}

I'm trying to return all the Listings that have a certain PropertyType (ie. 1). Am I on the right track here? I'd actually like to return results from the Listing table and NOT the "join" table.

Thanks!