public function getFrequentSearchTerms() : array
    {
        $frequentSearchConfiguration = $this->configuration->getSearchFrequentSearchesConfiguration();

        $identifier = $this->getCacheIdentifier($frequentSearchConfiguration);

        if ($this->cache->has($identifier)) {
            $terms = $this->cache->get($identifier);
        } else {
            $terms = $this->getFrequentSearchTermsFromStatistics($frequentSearchConfiguration);

            if ($frequentSearchConfiguration['sortBy'] === 'hits') {
                arsort($terms);
            } else {
                ksort($terms);
            }

            $lifetime = null;
            if (isset($frequentSearchConfiguration['cacheLifetime'])) {
                $lifetime = intval($frequentSearchConfiguration['cacheLifetime']);
            }

            $this->cache->set($identifier, $terms, [], $lifetime);
        }

        return $terms;
    }
public function getFrequentSearchTerms() : array
    {
        $frequentSearchConfiguration = $this->configuration->getSearchFrequentSearchesConfiguration();

        $identifier = $this->getCacheIdentifier($frequentSearchConfiguration);

        if ($this->cache->has($identifier)) {
            $terms = $this->cache->get($identifier);
        } else {
            $terms = $this->getFrequentSearchTermsFromStatistics($frequentSearchConfiguration);

            if ($frequentSearchConfiguration['sortBy'] === 'hits') {
                arsort($terms);
            } else {
                ksort($terms);
            }

            $lifetime = null;
            if (isset($frequentSearchConfiguration['cacheLifetime'])) {
                $lifetime = intval($frequentSearchConfiguration['cacheLifetime']);
            }

            $this->cache->set($identifier, $terms, [], $lifetime);
        }

        return $terms;
    }
public function getFrequentSearchTerms ( ) : array { $ frequentSearchConfiguration = $ this -> configuration -> getSearchFrequentSearchesConfiguration ( ) ; $ identifier = $ this -> getCacheIdentifier ( $ frequentSearchConfiguration ) ; if ( $ this -> cache -> has ( $ identifier ) ) { $ terms = $ this -> cache -> get ( $ identifier ) ; } else { $ terms = $ this -> getFrequentSearchTermsFromStatistics ( $ frequentSearchConfiguration ) ; if ( $ frequentSearchConfiguration [ 'sortBy' ] === 'hits' ) { arsort ( $ terms ) ; } else { ksort ( $ terms ) ; } $ lifetime = null ; if ( isset ( $ frequentSearchConfiguration [ 'cacheLifetime' ] ) ) { $ lifetime = intval ( $ frequentSearchConfiguration [ 'cacheLifetime' ] ) ; } $ this -> cache -> set ( $ identifier , $ terms , [ ] , $ lifetime ) ; } return $ terms ; }
Generates an array with terms and hits

@return array Tags as array with terms and hits
Generates an array with terms and hits