Jump to:

23368 Posts in 18143 Topics by 2863 members

General Questions

SilverStripe Forums » General Questions » Multiple PartialMatch

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 134 Views
  • blueace
    Avatar
    Community Member
    3 Posts

    Multiple PartialMatch Link to this post

    Hi,

    Can anyone confirm me that it is possible to do multiple PartialMatch in a single request (i'm using SS 3.1.2)?

    ie :

    $request = mydatabase::get()->filter(array(
             'type:PartialMatch' => "one",
             'type:PartialMatch' => "two"));

    For me only the last PartialMatch, so"two", is filtered. The first one is omited.

    My goal is to filter the data which contain both"one" and "two".

    Thanks

  • thomas.paulson
    Avatar
    Community Member
    67 Posts

    Re: Multiple PartialMatch Link to this post

    try row sql
    --------------
    http://doc.silverstripe.com/framework/en/topics/datamodel

    mydatabase::get()->where("\"type\" = '%one%' or \"type\" = '%two%' ");

    134 Views
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.