public static function getEventOccasions($post_id, $custom = false)
    {
        global $wpdb;
        $db_table = $wpdb->prefix."integrate_occasions";

        $query = "
        SELECT      *
        FROM        $db_table
        WHERE       $db_table.event_id = %d
        ";
        $query .= ($custom == true) ? "AND $db_table.content_mode = 'custom'" : '';
        $query .= "ORDER BY $db_table.start_date ASC";

        $completeQuery = $wpdb->prepare($query, $post_id);
        $occasions = $wpdb->get_results($completeQuery);

        return $occasions;
    }
public static function getEventOccasions($post_id, $custom = false)
    {
        global $wpdb;
        $db_table = $wpdb->prefix."integrate_occasions";

        $query = "
        SELECT      *
        FROM        $db_table
        WHERE       $db_table.event_id = %d
        ";
        $query .= ($custom == true) ? "AND $db_table.content_mode = 'custom'" : '';
        $query .= "ORDER BY $db_table.start_date ASC";

        $completeQuery = $wpdb->prepare($query, $post_id);
        $occasions = $wpdb->get_results($completeQuery);

        return $occasions;
    }
public static function getEventOccasions ( $ post_id , $ custom = false ) { global $ wpdb ; $ db_table = $ wpdb -> prefix . "integrate_occasions" ; $ query = "
        SELECT      *
        FROM        $db_table
        WHERE       $db_table.event_id = %d
        " ; $ query .= ( $ custom == true ) ? "AND $db_table.content_mode = 'custom'" : '' ; $ query .= "ORDER BY $db_table.start_date ASC" ; $ completeQuery = $ wpdb -> prepare ( $ query , $ post_id ) ; $ occasions = $ wpdb -> get_results ( $ completeQuery ) ; return $ occasions ; }
Get event occasions
@param  int $post_id post id
@param  bool $custom True to get occasions with custom content
@return array        object with occasions
Get event occasions