Support

Home Forums Event Espresso Premium EEM_Event Function to pull all events (including expired and inactive)

EEM_Event Function to pull all events (including expired and inactive)

Posted: January 19, 2018 at 1:52 pm

Viewing 4 reply threads


txhomedecor

January 19, 2018 at 1:52 pm

I’m working on a creating a report that will give a history of all events past, present and future. I’ve come across the below functions,

EEM_Event::instance()->get_upcoming_events
EEM_Event::instance()->get_active_events
EEM_Event::instance()->get_active_and_upcoming_events
EEM_Event::instance()->get_expired_events
EEM_Event::instance()->get_inactive_events

but was wondering if there was a “get_all” or an easy way to make sure i can get all of them?

ultimately it would be similar to this:
$events = EEM_Event::instance()->get_active_and_upcoming_events(array(
'order_by' => array('Datetime.DTT_EVT_start' => 'ASC')
));

Thanks!


Josh

  • Support Staff

January 19, 2018 at 3:13 pm

Hi txhomedecor,

There is a get_all() and there’s some documentation about it here:

https://github.com/eventespresso/event-espresso-core/blob/master/docs/G–Model-System/model-querying.md#get_all


txhomedecor

January 22, 2018 at 11:39 am

Thanks Josh. I’ve been playing around with it, but it still does not seem to pull everything. It seems pretty straight forward:

$events = EEM_Event::instance()->get_all(array(
'order_by' => array('Datetime.DTT_EVT_start' => 'ASC')
));

But this is the generated file:

Generated Output


txhomedecor

January 22, 2018 at 11:41 am

PS: make sure you scroll down in the file (lots of white space).


Josh

  • Support Staff

January 22, 2018 at 1:22 pm

Hi there,

I’m afraid what you’ve posted here lacks enough context to troubleshoot.

Viewing 4 reply threads

The support post ‘EEM_Event Function to pull all events (including expired and inactive)’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso