Get a list of upcoming events that this user is attending
@deprecated as of march 15 2016, 'user.getevents' method is not available
@param array $methodVars An array with the following required values: <i>user</i>
@return array
321464
public function getEvents($methodVars)
    {
        // Check for required variables
        if (!empty($methodVars['user'])) {
            $vars = array(
                'method' => 'user.getevents',
                'api_key' => $this->auth->apiKey
            );
            $vars = array_merge($vars, $methodVars);

            if ($call = $this->apiGetCall($vars)) {
                if ($call->events['total'] > 0) {
                    $i = 0;
                    foreach ($call->events->event as $event) {
                        $events[$i]['id'] = (string) $event->id;
                        $events[$i]['title'] = (string) $event->title;
                        $ii = 0;
                        foreach ($event->artists->artist as $artist) {
                            $events[$i]['artists'][$ii] = (string) $artist;
                            $ii++;
                        }
                        $events[$i]['headliner'] = (string) $event->artists->headliner;
                        $events[$i]['venue']['name'] = (string) $event->venue->name;
                        $events[$i]['venue']['location']['city'] = (string) $event->venue->location->city;
                        $events[$i]['venue']['location']['country'] = (string) $event->venue->location->country;
                        $events[$i]['venue']['location']['street'] = (string) $event->venue->location->street;
                        $events[$i]['venue']['location']['postalcode'] = (string) $event->venue->location->postalcode;
                        $geoPoints = $event->venue->location->children('http://www.w3.org/2003/01/geo/wgs84_pos#');
                        $events[$i]['venue']['location']['geopoint']['lat'] = (string) $geoPoints->point->lat;
                        $events[$i]['venue']['location']['geopoint']['long'] = (string) $geoPoints->point->long;
                        $events[$i]['venue']['timezone'] = (string) $event->venue->location->timezone;
                        $events[$i]['startDate'] = strtotime(trim((string) $event->startDate));
                        $events[$i]['description'] = (string) $event->description;
                        $events[$i]['images']['small'] = (string) $event->image[0];
                        $events[$i]['images']['medium'] = (string) $event->image[1];
                        $events[$i]['images']['large'] = (string) $event->image[2];
                        $events[$i]['attendance'] = (string) $event->attendance;
                        $events[$i]['reviews'] = (string) $event->reviews;
                        $events[$i]['tag'] = (string) $event->tag;
                        $events[$i]['url'] = (string) $event->url;
                        $i++;
                    }
                    return $events;
                } else {
                    throw new NoResultsException('This user has no events');
                }
            } else {
                return false;
            }
        } else {
            throw new InvalidArgumentException('You must include artist variable in the call for this method');
        }
    }
310900
public function query_vars( array $vars ){
        if( !empty($this->query_var) ){
            foreach( $this->query_var as $var ){
                if( false === array_search($var, $vars) ){
                    $vars[] = $var;
                }
            }
        }
        return $vars;
    }
880091
public function listPublicUserPerformedEvents(string $username): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/users/:username/events/public', $username));
    }
38062
public function getCalendars(array $options = []): array
    {
        $result = $conditions = [];

        if (!empty($options['conditions'])) {
            $conditions = $options['conditions'];
        }

        $query = $this->find()
                ->where($conditions)
                ->order(['name' => 'ASC'])
                ->all();
        $result = $query->toArray();

        if (empty($result)) {
            return $result;
        }

        foreach ($result as $item) {
            $item->event_types = $this->getEventTypes($item->event_types);
        }

        return $result;
    }
643865
protected function getEvents() {
        if (!$this->_events) {
            $this->_events = new EventList($this->version, $this->solution['sid']);
        }

        return $this->_events;
    }
87178
def list_events_view(request):
    '''  '''
    page_name = "Upcoming Events"
    profile = UserProfile.objects.get(user=request.user)
    event_form = EventForm(
        request.POST if 'post_event' in request.POST else None,
        profile=profile,
    )
    if event_form.is_valid():
        event_form.save()
        return HttpResponseRedirect(reverse('events:list'))

    # a pseudo-dictionary, actually a list with items of form (event, ongoing,
    # rsvpd, rsvp_form), where ongoing is a boolean of whether the event is
    # currently ongoing, rsvpd is a boolean of whether the user has rsvp'd to
    # the event
    events_dict = list()
    for event in Event.objects.filter(end_time__gte=now()):
        rsvp_form = RsvpForm(
            request.POST if "rsvp-{0}".format(event.pk) in request.POST else None,
            instance=event,
            profile=profile,
        )
        if rsvp_form.is_valid():
            rsvpd = rsvp_form.save()
            if rsvpd:
                message = MESSAGES['RSVP_ADD'].format(event=event.title)
            else:
                message = MESSAGES['RSVP_REMOVE'].format(event=event.title)
            messages.add_message(request, messages.SUCCESS, message)
            return HttpResponseRedirect(reverse('events:list'))

        ongoing = ((event.start_time <= now()) and (event.end_time >= now()))
        rsvpd = (profile in event.rsvps.all())
        events_dict.append((event, ongoing, rsvpd, rsvp_form))

    if request.method == "POST":
        messages.add_message(request, messages.ERROR, MESSAGES["EVENT_ERROR"])

    return render_to_response('list_events.html', {
        'page_name': page_name,
        'events_dict': events_dict,
        'now': now(),
        'event_form': event_form,
    }, context_instance=RequestContext(request))
1319667
public function getCalendars($params = array(), $public = false) {
		$defaults = array(
			'type' => 'object',
			'subtype' => 'calendar',
			'relationship' => Calendar::EVENT_CALENDAR_RELATIONSHIP,
			'relationship_guid' => $this->guid,
			'limit' => false
		);

		$options = array_merge($defaults, $params);

		if ($public) {
			$options['metadata_name_value_pairs'][] = array(
				'name' => '__public_calendar',
				'value' => true
			);
		}

		if ($options['count']) {
			return elgg_get_entities_from_relationship($options);
		}

		return new ElggBatch('elgg_get_entities_from_relationship', $options);
	}
534215
public function implementedEvents()
    {
        $events = parent::implementedEvents();

        $events['Crud.beforeRender'][] = ['callable' => [$this, 'publishSuccess']];

        if (method_exists($this, 'viewVar')) {
            $events['Crud.beforeRender'][] = ['callable' => [$this, 'publishViewVar']];
        }

        return $events;
    }
1165177
protected function getEvents()
    {
        $events = [];

        foreach ($this->laravel->getProviders(EventServiceProvider::class) as $provider) {
            $providerEvents = array_merge($provider->discoverEvents(), $provider->listens());

            $events = array_merge_recursive($events, $providerEvents);
        }

        if ($this->filteringByEvent()) {
            $events = $this->filterEvents($events);
        }

        return collect($events)->map(function ($listeners, $event) {
            return ['Event' => $event, 'Listeners' => implode(PHP_EOL, $listeners)];
        })->sortBy('Event')->values()->toArray();
    }
1036030
function event_list($params) {
		if ($this->version == 1) {
			// not supported currently.
			//$request_url = "{$this->url}&api_action=contact_delete_list&api_output={$this->output}&{$params}";
		} elseif ($this->version == 2) {
			$request_url = "{$this->url_base}/track/event";
		}
		$response = $this->curl($request_url, array(), "GET", "tracking_event_list");
		return $response;
	}
883674
public function getTopAlbums($methodVars)
    {
        // Check for required variables
        if (!empty($methodVars['artist']) || !empty($methodVars['mbid'])) {
            $vars = array(
                'method' => 'artist.gettopalbums',
                'api_key' => $this->auth->apiKey
            );
            $vars = array_merge($vars, $methodVars);

            if ($call = $this->apiGetCall($vars)) {
                if (count($call->topalbums->album) > 0) {
                    $i = 0;
                    foreach ($call->topalbums->album as $album) {
                        $topAlbums[$i]['rank'] = (string) $album['rank'];
                        $topAlbums[$i]['name'] = (string) $album->name;
                        $topAlbums[$i]['mbid'] = (string) $album->mbid;
                        $topAlbums[$i]['playcount'] = (string) $album->playcount;
                        $topAlbums[$i]['url'] = (string) $album->url;
                        $topAlbums[$i]['image']['small'] = (string) $album->image[0];
                        $topAlbums[$i]['image']['medium'] = (string) $album->image[1];
                        $topAlbums[$i]['image']['large'] = (string) $album->image[2];
                        $i++;
                    }

                    return $topAlbums;
                } else {
                    throw new NoResultsException('Artist has no top albums');
                }
            } else {
                return false;
            }
        } else {
            throw new InvalidArgumentException('You must include artist varialbe in the call for this method');
        }
    }
268194
public function getWeeklyChartList($methodVars)
    {
        // Check for required variables
        if (!empty($methodVars['user'])) {
            $vars = array(
                'method' => 'user.getweeklychartlist',
                'api_key' => $this->auth->apiKey
            );
            $vars = array_merge($vars, $methodVars);

            if ($call = $this->apiGetCall($vars)) {
                $i = 0;
                foreach ($call->weeklychartlist->chart as $chart) {
                    $weeklychartlist[$i]['from'] = (string) $chart['from'];
                    $weeklychartlist[$i]['to'] = (string) $chart['to'];
                    $i++;
                }

                return $weeklychartlist;
            } else {
                return false;
            }
        } else {
            throw new InvalidArgumentException('You must include artist variable in the call for this method');
        }
    }
1282272
public function retrieveCalendarEvents(){
        
        $select = $this->tableGateway->getSql()->select();
        // preparing columns for calendar ui
        // as defined column name for calendar ui
        $select->columns(
            array(
                new \Zend\Db\Sql\Expression('cal_id AS id'),
                new \Zend\Db\Sql\Expression('CONCAT(cal_id," : ",cal_event_title) AS title'),
                new \Zend\Db\Sql\Expression('cal_date_start AS start'),
                new \Zend\Db\Sql\Expression('cal_date_end AS end'),
            ));
        $dataCalendar = $this->tableGateway->selectWith($select);
        
        return $dataCalendar;
    }
274301
public function getTopTags($methodVars) {
		// Check for required variables
		if ( !empty($methodVars['artist']) && !empty($methodVars['track']) ) {
			$vars = array(
				'method' => 'track.gettoptags',
				'api_key' => $this->auth->apiKey
			);
			$vars = array_merge($vars, $methodVars);

			if ( $call = $this->apiGetCall($vars) ) {
				if ( count($call->toptags->tag) > 0 ) {
					$topTags['artist'] = (string) $call->toptags['artist'];
					$topTags['track'] = (string) $call->toptags['track'];
					$i = 0;
					foreach ( $call->toptags->tag as $tag ) {
						$topTags['tags'][$i]['name'] = (string) $tag->name;
						$topTags['tags'][$i]['count'] = (string) $tag->count;
						$topTags['tags'][$i]['url'] = (string) $tag->url;
						$i++;
					}
					return $topTags;
				}
				else {
					throw new NoResultsException('This track has no tags');
				}
			}
			else {
				return false;
			}
		}
		else {
			throw new InvalidArgumentException('You must include artist and track varialbes in the call for this method');
		}
	}
1010746
public function getTopAlbums($methodVars)
    {
        // Check for required variables
        if (!empty($methodVars['user'])) {
            $vars = array(
                'method' => 'user.gettopalbums',
                'api_key' => $this->auth->apiKey
            );
            $vars = array_merge($vars, $methodVars);

            if ($call = $this->apiGetCall($vars)) {
                if (count($call->topalbums->album) > 0) {
                    $i = 0;
                    foreach ($call->topalbums->album as $album) {
                        $topalbums[$i]['name'] = (string) $album->name;
                        $topalbums[$i]['playcount'] = (string) $album->playcount;
                        $topalbums[$i]['mbid'] = (string) $album->mbid;
                        $topalbums[$i]['url'] = (string) $album->url;
                        $topalbums[$i]['artist']['name'] = (string) $album->artist->name;
                        $topalbums[$i]['artist']['mbid'] = (string) $album->artist->mbid;
                        $topalbums[$i]['artist']['url'] = (string) $album->artist->url;
                        $topalbums[$i]['images']['small'] = (string) $album->image[0];
                        $topalbums[$i]['images']['medium'] = (string) $album->image[1];
                        $topalbums[$i]['images']['large'] = (string) $album->image[2];
                        $i++;
                    }

                    return $topalbums;
                } else {
                    throw new NoResultsException('This user has no top albums');
                }
            } else {
                return false;
            }
        } else {
            throw new InvalidArgumentException('You must include artist variable in the call for this method');
        }
    }
734818
public function getInfo($methodVars) {
		$vars = array(
			'method' => 'track.getinfo',
			'api_key' => $this->auth->apiKey
		);
		$vars = array_merge($vars, $methodVars);

		if ( $call = $this->apiGetCall($vars) ) {
			$info['id'] = (string) $call->track->id;
			$info['name'] = (string) $call->track->name;
			$info['mbid'] = (string) $call->track->mbid;
			$info['url'] = (string) $call->track->url;
			$info['duration'] = (string) $call->track->duration;
			$info['streamable'] = (string) $call->track->streamable;
			$info['fulltrack'] = (string) $call->track->streamable['fulltrack'];
			$info['listeners'] = (string) $call->track->listeners;
			$info['playcount'] = (string) $call->track->playcount;
			$info['artist']['name'] = (string) $call->track->artist->name;
			$info['artist']['mbid'] = (string) $call->track->artist->mbid;
			$info['artist']['url'] = (string) $call->track->artist->url;
			$info['album']['position'] = (string) $call->track->album['position'];
			$info['album']['artist'] = (string) $call->track->album->artist;
			$info['album']['title'] = (string) $call->track->album->title;
			$info['album']['mbid'] = (string) $call->track->album->mbid;
			$info['album']['url'] = (string) $call->track->album->url;
			$info['album']['image']['small'] = (string) $call->track->album->image[0];
			$info['album']['image']['medium'] = (string) $call->track->album->image[1];
			$info['album']['image']['large'] = (string) $call->track->album->image[2];
			$i = 0;
			foreach ( $call->track->toptags->tag as $tag ) {
				$info['toptags'][$i]['name'] = (string) $tag->name;
				$info['toptags'][$i]['url'] = (string) $tag->url;
				$i++;
			}
			$info['wiki']['published'] = (string) $call->track->wiki->published;
			$info['wiki']['summary'] = (string) $call->track->wiki->summary;
			$info['wiki']['content'] = (string) $call->track->wiki->content;

			return $info;
		}
		else {
			return false;
		}
	}
736896
public function getAllEventsHook($allEvents, $calendars, $start, $end, $module)
	{
		if (!($permissions = static::checkLogin()) || !in_array('beModules', $permissions)) {
			return $allEvents;
		}

		foreach ($allEvents as $key => $days) {
			foreach ($days as $day => $events) {
				foreach ($events as $index => $event) {
					$allEvents[$key][$day][$index]['class'] =
						(empty($event['class']) ? '' : $event['class'])
						. ' rsfh-event-' . $event['id'];
				}
			}
		}

		return $allEvents;
	}