Custom query for Pagelist
Permalink
I'd like to get a `Pagelist` object of multiple pages based on page names. However, I need the ability to do a query with 'OR's. For demonstration purposes, the query would be similar to:
With a `Pagelist` object, I can `filterByName`, but that doesn't allow for the `OR`. Any suggestions on how I can do this? Here's the basics of what I've got so far:
SELECT foo, foo2, foo3 FROM bar WHERE foo2 LIKE %art 101% OR foo2 LIKE %art 102%...
With a `Pagelist` object, I can `filterByName`, but that doesn't allow for the `OR`. Any suggestions on how I can do this? Here's the basics of what I've got so far:
Loader::model('page_list'); $pl = new Pagelist(); $pl->ignoreAliases(); $pl->filterByCollectionTypeHandle('course'); // I'd love to be able to create an array and pass it to the function, but that's not supported. $values = array('art 101', 'art 102'); $pl->filterByName($values); $pages = $pl->get(); $this->set('pages', $pages);