Forum
Perch collection multi filtering
Hi,
I'm trying to filter a collection based on three criterias: agenda_importance
, end_date
and is_pinned
. Essentially, if agenda_importance
and en_date
are set OR if is_pinned
is set, the content should be displayed.
perch_collection('Agenda', array(
'template' => 'agenda/agenda_push.html',
'sort' => 'start_date',
'sort-order' => 'DESC',
'filter' => array(
array(
'filter' => 'agenda_importance',
'match' => 'eq',
'value' => 'yes',
),
array(
'filter' => 'end_date',
'match'=>'gt',
'value' => date("Y-m-d"),
),
array(
'filter' => 'is_pinned',
'match' => 'eq',
'value' => 'yes'
)
)
));
I understand from the the docs that a filter having two array is by default AND and it can be set to OR. Could it be both?
Thanks!
It can't be both AND and OR. It's one or the other.