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.

General Questions

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

Multiple PartialMatch


Reply

2 Posts   162 Views

Avatar
blueace

13 March 2014 at 3:06pm (Last edited: 13 March 2014 3:07pm), Community Member, 3 Posts

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

Avatar
thomas.paulson

14 March 2014 at 11:23pm Community Member, 79 Posts

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

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