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!