Jump to:

17452 Posts in 4473 Topics by 1971 members


SilverStripe Forums » Archive » DataObject::get Many_Many

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

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

Page: 1
Go to End
Author Topic: 895 Views
  • Cy
    Community Member
    11 Posts

    DataObject::get Many_Many Link to this post

    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.


Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.