I have a question; I have a hard time finding out how to build a searchfilter in silverstipe.
I need to add this SQL to a searchfilter for a dataobject site search
‘HideList’ <> ‘1’ AND ‘LastDateTime’ > CURDATE() AND (‘ListDate’ IS NULL OR’ ListDate’ = '') OR ‘ListDate’ < NOW()) Sort By 'FirstDateTime'
The first 2 I get
array(
'HideList:not' => '1',
'LastDateTime:GreaterThan' => date("Y-m-d H:i:s"),
But the second part I need help, how do I create the following?
Is NULL statement (ListDate’ IS NULL)
An ‘OR’ statement (‘ListDate’ IS NULL OR’ ListDate’ = '') OR ‘ListDate’ < NOW())
Can you add a sort by in the searchfilter array?