5 if ( ! defined(
'GRAVITYVIEW_DIR' ) ) {
19 private $search_criteria = array();
31 $filter->search_criteria = $search_criteria;
48 $search_criteria = array();
50 foreach ( array(
'field_filters',
'start_date',
'end_date',
'status' ) as $key ) {
53 $field_filters = array_merge( empty( $a[ $key ] ) ? array() : $a[ $key ], empty( $b[ $key ] ) ? array() : $b[ $key ] );
54 if ( ! empty( $field_filters ) ) {
55 $search_criteria[ $key ] = $field_filters;
58 if ( ! empty( $b[ $key ][
'mode'] ) ) {
59 $search_criteria[ $key ][
'mode' ] = $b[ $key ][
'mode'];
60 }
else if ( ! empty( $a[ $key ][
'mode'] ) ) {
61 $search_criteria[ $key ][
'mode' ] = $a[ $key ][
'mode'];
67 if ( isset( $b[ $key ] ) ) {
68 $search_criteria[ $key ] = $b[ $key ];
69 }
else if ( isset( $a[ $key ] ) ) {
70 $search_criteria[ $key ] = $a[ $key ];
76 return $search_criteria;
87 return $this->search_criteria;
static from_search_criteria( $search_criteria)
Create a filter from this criteria.
If this file is called directly, abort.
static merge_search_criteria( $a, $b)
Merge two search criteria arrays.
If this file is called directly, abort.
as_search_criteria()
Get the $search_criteria.