List Wi-Fi channels usage
@param int $accessPointId
@return models\WiFi\Radar\ChannelUsage[]
975894
public function getChannelUsageFromId( $accessPointId) {
        $service = sprintf( self::API_WIFI_AP_CHANNEL_USAGE, $accessPointId);
        $rest = $this->getService( $service);
        $rest->GET();

        return $rest->getResultAsArray( models\WiFi\Radar\ChannelUsage::class);
    }
1198640
private function getSubPages($startPageId)
    {
        $where = $this->pageRepository->enableFields('pages')
            . ' AND ' . UrlEntry::EXCLUDE_FROM_SITEMAP . '!=1' . $this->pageAdditionalWhere;
        try {
            return $this->pageRepository->getMenu($startPageId, '*', 'sorting', $where);
        } catch (\Exception $exception) {
            return [];
        }
    }
518950
public function getStationsFromId( $accessPointId) {
        $service = sprintf( self::API_WIFI_AP_STATIONS, $accessPointId);
        $rest = $this->getService( $service);
        $rest->GET();

        return $rest->getResultAsArray( models\WiFi\APStation\Station::class);
    }
1351112
public function waitChannel($channelId)
    {
        while (true) {
            list($frameType, $frameChannel, $payload) = $this->waitFrame();
            if ($frameChannel == $channelId) {
                return array($frameType, $payload);
            }
            /**
             * Not the channel we were looking for.  Queue this frame
             * for later, when the other channel is looking for frames.
             */
            array_push(
                $this->channels[$frameChannel]->frame_queue,
                array($frameType, $payload)
            );

            /**
             * If we just queued up a method for channel 0 (the Connection
             * itself) it's probably a close method in reaction to some
             * error, so deal with it right away.
             */
            if (($frameType == 1) && ($frameChannel == 0)) {
                $this->wait();
            }
        }
        return array();
    }
214303
public function getDevices(): array
    {
        # If we've already retrieved the devices from cache then just return them
        if ($this->retrieved) {
            return $this->collection->getDevices();
        }

        # If we haven't cached the available addresses yet then do it now
        if (!$this->cache->has(self::CACHE_KEY)) {
            $addresses = [];
            foreach ($this->collection->getDevices() as $device) {
                $addresses[] = $device->getIp();
            }
            $this->cache->set(self::CACHE_KEY, $addresses);
        }

        $addresses = $this->cache->get(self::CACHE_KEY);
        foreach ($addresses as $address) {
            $this->collection->addIp($address);
        }
        $this->retrieved = true;

        return $this->collection->getDevices();
    }
551418
public function getAvailableIDs(): array
    {
        if ($this->availableTz === null) {
            $this->availableTz = [];
            $available = $this->timeZoneClass->getAvailableIDs();
            foreach ($available as $id) {
                $this->availableTz[] = $id;
            }
        }

        return $this->availableTz;
    }
297679
public function getCurrentPage($contextId = null)
    {
        $pager = $this->offsetGet($contextId) ?: $this->offsetGet('');

        return ($pager) ? $pager->current : 1;
    }
110993
@Override
    public List<Channel> getChannels()
    {
        List<Channel> channels = new LinkedList<>();
        if (_acceptingParty != null)
            channels.add(_acceptingParty);
        if (_originatingParty != null)
            channels.add(_originatingParty);
        if (_transferTargetParty != null)
            channels.add(_transferTargetParty);
        return channels;
    }
554700
public function getStreams($channelId = null)
    {
        if (!$channelId) {
            $channelId = $this->channelId;
        }

        if (!$channelId) {
            throw new MissingChannelIdException("You must specify the channel id");
        }

        if ($this->cache) {
            $data = $this->cache->fetch($this->getCacheKey($channelId));
            if ($data !== false) {
                return $data;
            }
        }

        $searchResponse = $this->client->get(
            'search',
            [
                'query' => [
                    'part' => 'id',
                    'channelId' => $channelId,
                    'eventType' => 'live',
                    'type' => 'video',
                    'maxResults' => 50
                ]
            ]
        );

        $searchData = json_decode($searchResponse->getBody()->getContents(), true);

        $videosResponse = $this->client->get(
            'videos',
            [
                'query' => [
                    'part' => 'id,snippet,liveStreamingDetails',
                    'id' => implode(
                        ',',
                        array_map(
                            function ($video) {
                                return $video['id']['videoId'];
                            },
                            $searchData['items']
                        )
                    )
                ]
            ]
        );

        $videosData = json_decode($videosResponse->getBody()->getContents(), true);

        $streams = array_map(
            function ($video) {
                return [
                    'name' => $video['snippet']['title'],
                    'thumb' => $video['snippet']['thumbnails']['high']['url'],
                    'videoId' => $video['id']
                ];
            },
            array_values(
                array_filter(
                    $videosData['items'],
                    function ($video) {
                        return !isset($video['liveStreamingDetails']['actualEndTime']);
                    }
                )
            )
        );

        if ($this->cache && $this->cacheTimeout > 0) {
            $this->cache->save($this->getCacheKey($channelId), $streams, $this->cacheTimeout);
        }

        return $streams;
    }
1133641
public function getSitePages($siteId)
    {
        $results = array();
        
        // Event parameters prepare
        $arrayParameters = $this->makeArrayFromParameters(__METHOD__, func_get_args());
        
        // Sending service start event
        $arrayParameters = $this->sendEvent('meliscmssite_service_get_site_pages_start', $arrayParameters);
        
        // Service implementation start
        
        $siteTable = $this->getServiceLocator()->get('MelisEngineTableSite');
        
        $site = $siteTable->getEntryById($arrayParameters['siteId'])->current();
        
        if (!empty($site))
        {
            $pages = $siteTable->getSiteSavedPagesById($site->site_id)->toArray();
            
            if (!empty($pages))
            {
                $site->pages = $pages;
            }
            
            $results = $site;
        }
        
        // Service implementation end
         
        // Adding results to parameters for events treatment if needed
        $arrayParameters['results'] = $results;
        // Sending service end event
        $arrayParameters = $this->sendEvent('meliscmssite_service_get_site_pages_start', $arrayParameters);
        
        return $arrayParameters['results'];
        
    }
428381
public function read($reportID) {
        $result = $this->api->request(
            'cmdb.reports',
            [
                'id' => $reportID
            ]
        );

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

        return $result;
    }
719809
public function subChannelGetById($cid)
  {
    if(!array_key_exists((int) $cid, $this->subChannelList()))
    {
      throw new Exception("invalid channelID", 0x300);
    }

    return $this->channelList[(int) $cid];
  }
790626
protected function get_slots_by_slotid($slots) {
        if (!$slots) {
            return array();
        }
        $newslots = array();
        foreach ($slots as $slot) {
            $newslots[$slot->id] = $slot;
        }
        return $newslots;
    }
1336279
protected function getDbRoutes($siteId = null): array
    {
        if ($siteId === null) {
            $siteId = Craft::$app->getSites()->currentSite->id;
        }
        if ($siteId === 'global') {
            $siteId = null;
        }
        // If we're on Craft 3.1 or later, just return the array from getProjectConfigRoutes();
        if (RouteMap::$craft31) {
            return Craft::$app->getRoutes()->getProjectConfigRoutes();
        }

        // Normalize the URL
        $results = (new Query())
            ->select(['uriPattern', 'template'])
            ->from(['{{%routes}}'])
            ->where([
                'or',
                ['siteId' => $siteId],
            ])
            ->orderBy(['sortOrder' => SORT_ASC])
            ->all();

        return ArrayHelper::map($results, 'uriPattern', function ($results) {
            return ['template' => $results['template']];
        });
    }
1224668
public function list_current_channels()
    {
        if (!$this->is_loggedin) {
            return false;
        }

        $response = $this->exec_curl('/api/s/' . $this->site . '/stat/current-channel');

        return $this->process_response($response);
    }
177908
public function broadcastWith()
    {
        return [
            'id' => $this->id,
            'webhook' => $this->webhook,
            'request' => $this->request,
            'response' => $this->response,
            'status' => $this->status,
        ];
    }
927106
public function getAccessTokenList($userId)
    {
        self::requireSession();
        if (false === \array_key_exists(\sprintf('_oauth2_token_%s', $userId), $_SESSION)) {
            return [];
        }

        return $_SESSION[\sprintf('_oauth2_token_%s', $userId)];
    }