public function getLastSearches()
    {
        $lastSearchesKeywords = [];
        $mode   = $this->configuration->getSearchLastSearchesMode();
        $limit  = $this->configuration->getSearchLastSearchesLimit();

        switch ($mode) {
            case 'user':
                $lastSearchesKeywords = $this->getLastSearchesFromSession($limit);
                break;
            case 'global':
                $lastSearchesKeywords = $this->lastSearchesRepository->findAllKeywords($limit);
                break;
        }

        return $lastSearchesKeywords;
    }
public function getLastSearches()
    {
        $lastSearchesKeywords = [];
        $mode   = $this->configuration->getSearchLastSearchesMode();
        $limit  = $this->configuration->getSearchLastSearchesLimit();

        switch ($mode) {
            case 'user':
                $lastSearchesKeywords = $this->getLastSearchesFromSession($limit);
                break;
            case 'global':
                $lastSearchesKeywords = $this->lastSearchesRepository->findAllKeywords($limit);
                break;
        }

        return $lastSearchesKeywords;
    }
public function getLastSearches ( ) { $ lastSearchesKeywords = [ ] ; $ mode = $ this -> configuration -> getSearchLastSearchesMode ( ) ; $ limit = $ this -> configuration -> getSearchLastSearchesLimit ( ) ; switch ( $ mode ) { case 'user' : $ lastSearchesKeywords = $ this -> getLastSearchesFromSession ( $ limit ) ; break ; case 'global' : $ lastSearchesKeywords = $ this -> lastSearchesRepository -> findAllKeywords ( $ limit ) ; break ; } return $ lastSearchesKeywords ; }
Retrieves the last searches from the session or database depending on the configuration.

@return array
Retrieves the last searches from the session or database depending on the configuration .