Allows you to access information about the current events at a place.
@param string $venueId
@return array
519900
public function events($venueId)
    {

        $resource = '/venues/' . $venueId . '/events';
        $response = $this->makeApiRequest($resource);

        if(property_exists($response, 'events')) {
            return $response->events->items;
        }

        return array();

    }
1226826
public static function get_calendar_event_by_id($eventid) {
        global $PAGE, $USER;

        $params = self::validate_parameters(self::get_calendar_event_by_id_parameters(), ['eventid' => $eventid]);
        $context = \context_user::instance($USER->id);

        self::validate_context($context);
        $warnings = array();

        $legacyevent = calendar_event::load($eventid);
        // Must check we can see this event.
        if (!calendar_view_event_allowed($legacyevent)) {
            // We can't return a warning in this case because the event is not optional.
            // We don't know the context for the event and it's not worth loading it.
            $syscontext = context_system::instance();
            throw new \required_capability_exception($syscontext, 'moodle/course:view', 'nopermission', '');
        }

        $legacyevent->count_repeats();

        $eventmapper = event_container::get_event_mapper();
        $event = $eventmapper->from_legacy_event_to_event($legacyevent);

        $cache = new events_related_objects_cache([$event]);
        $relatedobjects = [
            'context' => $cache->get_context($event),
            'course' => $cache->get_course($event),
        ];

        $exporter = new event_exporter($event, $relatedobjects);
        $renderer = $PAGE->get_renderer('core_calendar');

        return array('event' => $exporter->export($renderer), 'warnings' => $warnings);
    }
136331
private function getDatabaseStructureEvents()
    {
        // Listing all events from database
        if ($this->dumpSettings['events']) {
            foreach ($this->dbHandler->query($this->typeAdapter->show_events($this->dbName)) as $row) {
                array_push($this->events, $row['event_name']);
            }
        }
        return;
    }
615171
public function getEventInfo(?string $id = null, ?EntityInterface $calendar = null)
    {
        $result = [];

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

        $options = $this->getRecurrenceEventId($id);

        /** @var \Cake\ORM\Query $query */
        $query = $this->find()
                ->where(['id' => $options['id']])
                ->contain(['CalendarAttendees']);
        $result = $query->first();

        if (!($result instanceof EntityInterface)) {
            return [];
        }

        //@NOTE: we're faking the start/end intervals for recurring events
        if (!empty($options['end'])) {
            $time = Time::parse($options['end']);
            $result->set('end_date', $time);
            $result->set('end', $time);
            unset($time);
        }

        if (!empty($options['start'])) {
            $time = Time::parse($options['start']);
            $result->set('start_date', $time);
            $result->set('start', $time);
            unset($time);
        }

        if ($calendar) {
            if (empty($result->calendar_id)) {
                $result->set('calendar_id', $calendar->id);
            }
        }

        $result->set('color', $this->Calendars->getColor($calendar));

        return $result;
    }
1054391
public function getActiveSiteTheme($siteId)
    {
        $qb = $this->getEntityManager()->createQueryBuilder();
        /** @var $query \Doctrine\ORM\Query */

        $query = $qb->select('e, t')
            ->from($this->_entity, 'e')
            ->innerJoin('e.themeId', 't')
            ->where('e.siteId = :id')
            ->andWhere('e.isActive = 1')
            ->setMaxResults(1)
            ->setParameter('id', $siteId)
            ->getQuery();

        /** @var $result \PageBuilder\Entity\Join\SiteTheme */
        $result = $query->getOneOrNullResult(AbstractQuery::HYDRATE_OBJECT);
        if ($result) {
            return $result->getThemeId();
        } else {
            return $result;
        }
    }
1071518
protected function getSiteForRootPageId(int $pageId): array
    {
        return is_array($this->sites[$pageId]) ? $this->sites[$pageId] : [];
    }
26701
public static function get_calendar_access_information($courseid = 0) {

        $params = self::validate_parameters(self::get_calendar_access_information_parameters(), ['courseid' => $courseid]);

        if (empty($params['courseid']) || $params['courseid'] == SITEID) {
            $context = \context_system::instance();
        } else {
            $context = \context_course::instance($params['courseid']);
        }

        self::validate_context($context);

        return [
            'canmanageentries' => has_capability('moodle/calendar:manageentries', $context),
            'canmanageownentries' => has_capability('moodle/calendar:manageownentries', $context),
            'canmanagegroupentries' => has_capability('moodle/calendar:managegroupentries', $context),
            'warnings' => [],
        ];
    }
353000
public function getVenue()
    {
        if (!$this->venue && $this->venueId) {
            $this->venue = $this->getRelated('venue');
        }
        return $this->venue;
    }
387262
public function getEventAlbums($eventId)
    {
        if (is_null($eventId) || $eventId == '') {
            throw new Exception('The eventId is required to check if a photo exists.');
        }

        $params = array(
            'method' => 'sp.album.get_list',
            'event_id' => $eventId
        );

        return $this->_makeApiRequest($params);
    }
123890
def get_venue_details(self, venue_id):

        ''' 
        '''

        title = '%s.get_venue_details' % self.__class__.__name__

    # validate inputs
        input_fields = {
            'venue_id': venue_id
        }
        for key, value in input_fields.items():
            if value:
                object_title = '%s(%s=%s)' % (title, key, str(value))
                self.fields.validate(value, '.%s' % key, object_title)

    # construct request fields
        url = '%s/2/venues' % self.endpoint
        params = {
            'venue_id': str(venue_id)
        }

    # send request
        venue_details = self._get_request(url, params=params)

    # reconstruct method output
        if venue_details['json']:
            if 'results' in venue_details['json'].keys():
                if venue_details['json']['results']:
                    details = venue_details['json']['results'][0]
                    venue_details['json'] = self.objects.venue.ingest(**details)

        return venue_details
436017
public function getEventMessageSites($messageId) {
        $dbres = \CEventMessage::GetLang($messageId);
        return $this->fetchAll($dbres, false, 'LID');
    }
195233
public static function get_course_groups($courseid) {
        $params = self::validate_parameters(self::get_course_groups_parameters(), array('courseid'=>$courseid));

        // now security checks
        $context = context_course::instance($params['courseid'], IGNORE_MISSING);
        try {
            self::validate_context($context);
        } catch (Exception $e) {
                $exceptionparam = new stdClass();
                $exceptionparam->message = $e->getMessage();
                $exceptionparam->courseid = $params['courseid'];
                throw new moodle_exception('errorcoursecontextnotvalid' , 'webservice', '', $exceptionparam);
        }
        require_capability('moodle/course:managegroups', $context);

        $gs = groups_get_all_groups($params['courseid'], 0, 0,
            'g.id, g.courseid, g.name, g.idnumber, g.description, g.descriptionformat, g.enrolmentkey');

        $groups = array();
        foreach ($gs as $group) {
            list($group->description, $group->descriptionformat) =
                external_format_text($group->description, $group->descriptionformat,
                        $context->id, 'group', 'description', $group->id);
            $groups[] = (array)$group;
        }

        return $groups;
    }
799791
public function getSectionEvents($id)
    {
        return isset($this->sections[$id]) ? $this->sections[$id]->getEvents() : [];
    }
1273925
public function getForumInfo($id)
    {
        $id = Container::get('hooks')->fire('model.forum.get_info_forum_start', $id);

        $cur_forum['where'] = [
            ['fp.read_forum' => 'IS NULL'],
            ['fp.read_forum' => '1']
        ];

        if (!User::get()->is_guest) {
            $cur_forum['select'] = [
                'f.forum_name',
                'f.redirect_url',
                'f.moderators',
                'f.num_topics',
                'f.sort_by',
                'fp.post_topics',
                'is_subscribed' => 's.user_id'
            ];

            $cur_forum = DB::forTable('forums')->table_alias('f')
                            ->select_many($cur_forum['select'])
//                            ->left_outer_join(DB::prefix().'forum_subscriptions',
// array('f.id', '=', 's.forum_id'), 's')
//                            ->left_outer_join(DB::prefix().'forum_subscriptions',
// array('s.user_id', '=', User::get()->id), null, true)
                    ->left_outer_join(
                    DB::prefix().'forum_subscriptions',
                        '(f.id = s.forum_id AND s.user_id = '.User::get()->id.')',
                        's'
                    )
//                            ->left_outer_join(DB::prefix().'forum_perms',
// array('fp.forum_id', '=', 'f.id'), 'fp')
//                            ->left_outer_join(DB::prefix().'forum_perms',
// array('fp.group_id', '=', User::get()->g_id), null, true)
                ->left_outer_join(
                    DB::prefix().'forum_perms',
                    '(fp.forum_id = f.id AND fp.group_id = '.User::get()->g_id.')',
                    'fp'
                )
                ->where_raw('(fp.read_forum IS NULL OR fp.read_forum=1)')
//                ->where_any_is($cur_forum['where'])
                            ->where('f.id', $id);
        } else {
            $cur_forum['select'] = [
                'f.forum_name',
                'f.redirect_url',
                'f.moderators',
                'f.num_topics',
                'f.sort_by',
                'fp.post_topics'
            ];

            $cur_forum = DB::forTable('forums')->table_alias('f')
                            ->select_many($cur_forum['select'])
                            ->select_expr(0, 'is_subscribed')
//                            ->left_outer_join(DB::prefix().'forum_perms',
// array('fp.forum_id', '=', 'f.id'), 'fp')
//                            ->left_outer_join(DB::prefix().'forum_perms',
// array('fp.group_id', '=', User::get()->g_id), null, true)
                ->left_outer_join(
                    DB::prefix().'forum_perms',
                    '(fp.forum_id = f.id AND fp.group_id = '.User::get()->g_id.')',
                    'fp'
                )
//                            ->where_any_is($cur_forum['where'])
                ->where_raw('(fp.read_forum IS NULL OR fp.read_forum=1)')
                            ->where('f.id', $id);
        }

        $cur_forum = Container::get('hooks')->fireDB('model.forum.get_info_forum_query', $cur_forum);
        $cur_forum = $cur_forum->find_one();

        if (!$cur_forum) {
            throw new RunBBException(__('Bad request'), '404');
        }

        $cur_forum = Container::get('hooks')->fire('model.forum.get_info_forum', $cur_forum);

        return $cur_forum;
    }
887990
def get_user_venues(self, id, **data):
        
        
        return self.get("/users/{0}/venues/".format(id), data=data)
809103
public function search(array $params = array())
    {
        $resource = '/venues/search';
        $response = $this->makeApiRequest($resource, $params);

        if(property_exists($response, 'venues')) {
            return $response->venues;
        }
        
        return array();
    }
55516
public function getCampaignSettingsById($campaignId)
    {
        $results = [];
        if (
            $campaignId
            && isset($this->campaignSettings)
            && isset($this->campaignSettings->campaigns)
            && is_array($this->campaignSettings->campaigns)
        ) {
            // Note, there may be multiple matches for the same campaignId for future mapping purposes, so we aggregate.
            foreach ($this->campaignSettings->campaigns as $id => $campaign) {
                if (isset($campaign->campaignId) && $campaign->campaignId == $campaignId) {
                    $results[$id] = $campaign;
                }
            }
        }

        return $results;
    }