Complex Conditionals with ElementCriteriaModel / Element API Working with the Element API for the first time and I'm having a bit of a hard time finding any kind of documentation regarding writing more complex conditionals using the ElementCriteriaModel.

What I'm trying to accomplish, is selecting all entries (they are events with a start/end date as custom fields) from a given section, which overlap in any way with a passed-in query start/end date.

It is probably easier to simply supply the raw query that works, and perhaps someone could point me in the direction of documentation that could help me.

SELECT *
FROM craft_content
WHERE
! ( field_eventStartDate &gt; @queryStartDate AND field_eventStartDate &gt; @queryEndDate)
AND
! ( field_eventEndDate &lt; @queryStartDate AND field_eventEndDate &lt; @queryEndDate )
After doing a bit more digging, I think the only real option here is run a preliminary query to pull out the ids of the elements I want and then pass that into the ElementCriteriaModel. It's not ideal, but it'll do.