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   218 Views

Avatar
blueace

Community Member, 3 Posts

13 March 2014 at 3:06pm

Edited: 13/03/2014 3:07pm

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

Community Member, 84 Posts

14 March 2014 at 11:23pm

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

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