Get the top keywords for duration
@return \Spatie\Analytics\Collection
504369
public function getKeywords()
    {
        $period = $this->analyticsDuration();

        $data = Analytics::performQuery($period, 'ga:sessions', [
            'max-results' => 30,
            'dimensions'  => 'ga:keyword',
            'sort'        => '-ga:sessions',
            //'filters'     => 'ga:keyword!=(not set);ga:keyword!=(not provided)'
        ]);

        $items = [];
        // if not null
        if (!is_null($data->rows)) {
            foreach ($data->rows as $row) {
                $items[] = ['keyword' => $row[0], 'sessions' => $row[1]];
            }
        }

        return $items;
    }
626929
public function getEntries()
    {
        return array(
            $this->getMinute(),
            $this->getHour(),
            $this->getDayOfMonth(),
            $this->getMonth(),
            $this->getDayOfWeek(),
            $this->getCommand(),
            $this->prepareLog(),
            $this->prepareError(),
            $this->prepareComments(),
        );
    }
501644
public function getBrowsers()
    {
        $period = $this->analyticsDuration();
        $data = Analytics::fetchTopBrowsers($period)->toArray();

        $items = [];
        shuffle($data); // shuffle results / randomimize chart color sections
        foreach ($data as $k => $item) {
            $items[] = $this->getPieDataSet($item['browser'], $item['sessions'], $k);
        }

        return $items;
    }
1320212
public function top()
    {
        $objects = array_values($this->__data);

        $object = null;
        if (isset($objects[0])) {
            $object = $objects[0];
        }

        return $object;
    }
6765
def _get_keywords(self, **kwargs):
        """"""
        if self.jurisdiction and 'jurisdiction_id' not in kwargs:
            kwargs['jurisdiction_id'] = self.jurisdiction
        if 'count' in kwargs:
            kwargs['page_size'] = kwargs.pop('count')
        if 'start' in kwargs:
            start = kwargs.pop('start')
            if 'end' in kwargs:
                end = kwargs.pop('end')
            else:
                end = date.today().strftime('%m-%d-%Y')
            start, end = self._format_dates(start, end)
            kwargs['start_date'] = start
            kwargs['end_date'] = end
        elif 'between' in kwargs:
            start, end = kwargs.pop('between')
            start, end = self._format_dates(start, end)
            kwargs['start_date'] = start
            kwargs['end_date'] = end
        return kwargs
402156
public function getTopChildren()
    {
        if (is_null($this->topMenuItems)) {
            $this->topMenuItems = [];
            foreach ($this->adaptors as $menuAdaptor) {
                $menuAdaptor->adaptChildren($this, $this->topMenuItems, null, $this->getRequest());
            }
        }

        return $this->topMenuItems;
    }
475161
public function WordCollection()
	{
		$myWords = parent::WordCollection();
		
		if (!($myWords->loadedFromFile()))
		{
			// English Words
			$myWords->addText("en-us", "TITLE", "Module Send page");

			// Portuguese Words
			$myWords->addText("pt-br", "TITLE", "Módulo de Envio de Páginas");
		}
		return $myWords;
	}
60610
public function getTotalRecords()
    {
        $qb = clone $this->queryBuilder;
        $this->_addSearch($qb);
        $qb->resetDQLPart('orderBy');

        $gb = $qb->getDQLPart('groupBy');
        if (empty($gb) || !in_array($this->fields['_identifier_'], $gb))
        {
            $qb->select(" count({$this->fields['_identifier_']}) ");
            return $qb->getQuery()->getSingleScalarResult();
        }
        else
        {
            $qb->resetDQLPart('groupBy');
            $qb->select(" count(distinct {$this->fields['_identifier_']}) ");
            return $qb->getQuery()->getSingleScalarResult();
        }
    }
108515
public function last()
    {
        $this->generatorToArray();

        $key_last = \array_key_last($this->array);

        if ($key_last === null) {
            return null;
        }

        return $this->get($key_last);
    }
915824
public function getTopChildren()
    {
        $result = [];
        $children = $this->getChildren();
        foreach ($children as $child) {
            if ($child instanceof TopMenuItem) {
                $result[] = $child;
            }
        }

        return $result;
    }
1180327
public function getKeywords()
    {
        $keywords = Cii::get($this->params['meta'], 'keywords', '');
        if (Cii::get($keywords, 'value', false) != false)
            $keywords = implode(',', json_decode($keywords['value']));
            
        return $keywords == "" ? Cii::get($this->params['data'], 'title', Cii::getConfig('name', Yii::app()->name)): $keywords;
    }
900292
public function summary()
	{
		$summary = array(
			'start'  => $this->started(),
			'end'    => $this->ended(),
			'total'  => $this->duration(),
			'memory' => $this->memory()
		);

		return $summary;
	}
577353
protected function get_collection_to() {
        if ($this->collectionto === null) {
            $this->collectionto = api::search_competencies('', $this->to);
        }
        return $this->collectionto;
    }
321153
public function top()
    {
        $objects = array_values($this->_data);

        $object = null;
        if (isset($objects[0])) {
            $object = $objects[0];
        }

        return $object;
    }
921421
public function getTopKeywords($numberOfDays = 365, $maxResults = 30)
    {
        list($startDate, $endDate) = $this->calculateNumberOfDays($numberOfDays);

        return $this->getTopKeyWordsForPeriod($startDate, $endDate, $maxResults);
    }
425556
protected function &GetSearchKeywordCloud()
    {
        $iSize = 13;
        $aCustomWords = array();
        $oCustomList = &TdbShopSearchCloudWordList::GetList();
        while ($oWord = &$oCustomList->Next()) {
            $aCustomWords[$oWord->fieldName] = $oWord->fieldWeight;
        }
        $iSize = $iSize - count($aCustomWords);
        if ($iSize < 0) {
            $iSize = 0;
        }
        $activeLanguage = $this->getLanguageService()->getActiveLanguageId();
        $query = 'SELECT COUNT(`shop_search_log`.`id`) AS '.TCMSTagCloud::QUERY_ITEM_COUNT_NAME.',
                       `shop_search_log`.`name` AS '.TCMSTagCloud::QUERY_ITEM_KEY_NAME.",
                       `shop_search_log`.*
                  FROM `shop_search_log`
                 WHERE `cms_language_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($activeLanguage)."' OR `cms_language_id` =  ''
              GROUP BY `shop_search_log`.`name`
                HAVING ".TCMSTagCloud::QUERY_ITEM_COUNT_NAME.' > 0
              ORDER BY '.TCMSTagCloud::QUERY_ITEM_COUNT_NAME." DESC
                 LIMIT 0,{$iSize}
               ";
        // add custom words...

        return TCMSTagCloud::GetCloud($query, 'TdbShopSearchLog', $aCustomWords);
    }
1012275
public function toPairs()
    {
        $result = [];
        foreach ($this as $key => $value) {
            $result[] = [$key, $value];
        }
        return $result;
    }