public function getEvents($module_id, $page = 1, $useLimit = true)
    {
        $fields = json_decode(json_encode(get_fields($module_id)));
        $display_limit = ($useLimit == true && isset($fields->mod_event_limit)) ? $fields->mod_event_limit : -1;
        $days_ahead = isset($fields->mod_event_interval) ? $fields->mod_event_interval : 0;

        // Set start and end date
        $start_date = date('Y-m-d H:i:s', strtotime("today midnight"));
        $end_date = date('Y-m-d H:i:s', strtotime("tomorrow midnight +$days_ahead days") - 1);

        // Save categories, groups and tags IDs as arrays
        $categories = $this->getModuleCategories($module_id);
        $tags = $this->getModuleTags($module_id);
        $groups = $this->getModuleGroups($module_id);

        $taxonomies = (!empty($taxonomies)) ? $taxonomies : null;
        $params = array(
            'start_date' => $start_date,
            'end_date' => $end_date,
            'display_limit' => $display_limit,
            'categories' => $categories,
            'tags' => $tags,
            'groups' => $groups,
            'location' => (isset($fields->mod_event_geographic)) ? $fields->mod_event_geographic : null,
            'distance' => (isset($fields->mod_event_distance)) ? $fields->mod_event_distance : null,
            'lang' => $this->lang,
        );

        $events = \EventManagerIntegration\Helper\QueryEvents::getEventsByInterval($params, $page);

        return $events;
    }
public function getEvents($module_id, $page = 1, $useLimit = true)
    {
        $fields = json_decode(json_encode(get_fields($module_id)));
        $display_limit = ($useLimit == true && isset($fields->mod_event_limit)) ? $fields->mod_event_limit : -1;
        $days_ahead = isset($fields->mod_event_interval) ? $fields->mod_event_interval : 0;

        // Set start and end date
        $start_date = date('Y-m-d H:i:s', strtotime("today midnight"));
        $end_date = date('Y-m-d H:i:s', strtotime("tomorrow midnight +$days_ahead days") - 1);

        // Save categories, groups and tags IDs as arrays
        $categories = $this->getModuleCategories($module_id);
        $tags = $this->getModuleTags($module_id);
        $groups = $this->getModuleGroups($module_id);

        $taxonomies = (!empty($taxonomies)) ? $taxonomies : null;
        $params = array(
            'start_date' => $start_date,
            'end_date' => $end_date,
            'display_limit' => $display_limit,
            'categories' => $categories,
            'tags' => $tags,
            'groups' => $groups,
            'location' => (isset($fields->mod_event_geographic)) ? $fields->mod_event_geographic : null,
            'distance' => (isset($fields->mod_event_distance)) ? $fields->mod_event_distance : null,
            'lang' => $this->lang,
        );

        $events = \EventManagerIntegration\Helper\QueryEvents::getEventsByInterval($params, $page);

        return $events;
    }
public function getEvents ( $ module_id , $ page = 1 , $ useLimit = true ) { $ fields = json_decode ( json_encode ( get_fields ( $ module_id ) ) ) ; $ display_limit = ( $ useLimit == true && isset ( $ fields -> mod_event_limit ) ) ? $ fields -> mod_event_limit : - 1 ; $ days_ahead = isset ( $ fields -> mod_event_interval ) ? $ fields -> mod_event_interval : 0 ; // Set start and end date $ start_date = date ( 'Y-m-d H:i:s' , strtotime ( "today midnight" ) ) ; $ end_date = date ( 'Y-m-d H:i:s' , strtotime ( "tomorrow midnight +$days_ahead days" ) - 1 ) ; // Save categories, groups and tags IDs as arrays $ categories = $ this -> getModuleCategories ( $ module_id ) ; $ tags = $ this -> getModuleTags ( $ module_id ) ; $ groups = $ this -> getModuleGroups ( $ module_id ) ; $ taxonomies = ( ! empty ( $ taxonomies ) ) ? $ taxonomies : null ; $ params = array ( 'start_date' => $ start_date , 'end_date' => $ end_date , 'display_limit' => $ display_limit , 'categories' => $ categories , 'tags' => $ tags , 'groups' => $ groups , 'location' => ( isset ( $ fields -> mod_event_geographic ) ) ? $ fields -> mod_event_geographic : null , 'distance' => ( isset ( $ fields -> mod_event_distance ) ) ? $ fields -> mod_event_distance : null , 'lang' => $ this -> lang , ) ; $ events = \ EventManagerIntegration \ Helper \ QueryEvents :: getEventsByInterval ( $ params , $ page ) ; return $ events ; }
Get included Events
@param  int  $module_id Module ID
@param  int  $page      Pagination page number
@param  bool $useLimit  True = limit by setting, false = get all
@return array           Array with event objects
Get included Events