Support » Plugin: Events Manager » Simplest way to get all Events as an Array

  • Resolved kn1g



    just looking for the simplest way to get all Events as an simple Array like:

      array(All elements of Event1)
      array(All elements of Event2)

    I would try to get it directly out of the database. But if there is a more comfortable way, please let me know! 🙂

    I am trying to build a JSON controller to output the events.

Viewing 5 replies - 1 through 5 (of 5 total)
  • ok, sry. I tried only “output” before. I think “get” will do the job 😉

    Could it be that the option EM_Events::output(array( 'order'=>'DESC' does not work?

    tried $EM_Events = EM_Events::get(array('limit'=>$maxEventsDisplayed, 'orderby'=>'start_date'));
    But got in trouble as i tried to access the elements. like $EM_Events[0]['event_id'] was not possible. How can i access the elements of the class? (Didn’t find a specific “getter” function) like “get_event_id”.

    Sry, but i am still a bit confused by the structure of the Event classes and the task to loop properly through all events.

    maybe this will help –


    $EM_Events = EM_Events::get(array('limit'=>$maxEventsDisplayed, 'orderby'=>'start_date'));
    foreach ( $EM_Events as $EM_Event ) {
     echo $EM_Event->event_id;

    Plugin Author Marcus


    NetWebLogic Support

    you can also try this if you want just an array:


    However, the event objects can be useful as they have loads of functions to help display things, check bookings etc.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Simplest way to get all Events as an Array’ is closed to new replies.