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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Multiple PartialMatch


Go to End


2 Posts   1057 Views

Avatar
blueace

Community Member, 5 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, 107 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%' ");