I want to search for Entries of the same channel/section based on their type. Let's say, we are a travel company with two types of tours: "guided group" and "private". For group tours, we want trips associated with a particular provider. For private tours, we want trips less than a certain price (this field is N/A for group journeys).
In the controller:
$criteriaFilters = [
'section'=>'journeys',
'relatedTo'=> [<ids of the provider>],// Should be for group only
'price'=>'<10', // Should be for private tour only
];
$criteria = craft()->elements->getCriteria(
ElementType::Entry,
$criteriaFilters
);
I need to retrieve them all in an ElementCriteriaModel object, via one SQL query. I don't want to get all private and guided tours separately and then combine them because that doesn't work well with pagination.
What do you think is best to achieve this? (in PHP, not Twig)
relatedTois equal to some list of entries ORpriceis less than some amount and get a single result set back? – Brad Bell Jun 29 '15 at 18:19