File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,17 @@ public function extractContent($folder, $options)
109109
110110 // Prepare the criteria for this context
111111 $ contextCriteria = ($ criteria ) ? $ criteria : array ();
112- $ contextCriteria ['context_key ' ] = $ contextKey ;
112+
113+ // Accept OR conditions (see: https://github.com/modmore/Gitify/pull/197)
114+ if (empty ($ contextCriteria ) || count (array_filter (array_keys ($ contextCriteria ), 'is_string ' )) > 0 ) {
115+ // associative array => and conditions
116+ $ contextCriteria ['context_key ' ] = $ contextKey ;
117+ } else {
118+ // sequential array => or conditions
119+ foreach ($ contextCriteria as $ i => $ orCondition ) {
120+ $ contextCriteria [$ i ]['context_key ' ] = $ contextKey ;
121+ }
122+ }
113123
114124 // Grab the count
115125 $ count = $ this ->modx ->getCount ('modResource ' , $ contextCriteria );
You can’t perform that action at this time.
0 commit comments