Getting started with the ORM API
-
Hi,
I’m trying to programmatically get a list of events between two dates. Actually between ‘now’ and two days time.
After trying the sql route (which ended in tears, lost within with the tec custom tables logic), I thought I’d try and do it properly and after discovering the ORM API documentation I got quite excited. [https://docs.theeventscalendar.com/apis/orm/]The documents give some examples but not a complete list of keywords, syntax etc.
I was expecting to find an and() function to combine logical expressions together. There is no such function.
The best I’ve come up with so far is
$events = tribe_events()
->where(‘start_date’, ‘>=’, ‘2023-02-14’)
->where(‘start_date’, ‘<=’, ‘2023-02-16’) ->pluck( ‘ID’ );Whatever combination of dates I use, I get 150 results which is clearly incorrect.
Can anyone help get me going, or point me to some more extensive documentation
Thanks in advance, Jerry
- The topic ‘Getting started with the ORM API’ is closed to new replies.