Skip to content

Instantly share code, notes, and snippets.

@lorenzo
Created May 21, 2014 07:53
Show Gist options
  • Save lorenzo/40aee8d76386b499bdf3 to your computer and use it in GitHub Desktop.
Save lorenzo/40aee8d76386b499bdf3 to your computer and use it in GitHub Desktop.
<?php
$query
->clause('where')
->traverse(function($exp) {
$exp->iterateParts(function($part) {
if ($part instanceof Comparison && $part->getField() === 'type') {
return new QueryExpression([$part, ['id IN' => $ids]], [], 'OR');
}
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment