src/Query/Algolia/SearchQuery.php
public function toArray()
    {
        $query = [
            'numericFilters' => '',
            'facetFilters'   => '',
        ];

        if ($this->query != '') {
            $query['query'] = $this->query;
        }

        if ($this->useLocationAwareSearch) {
            $query['aroundLatLng'] = $this->lat.','.$this->lng;
            $query['aroundRadius'] = $this->aroundRadius;
        }

        foreach ($this->dateRestrictions as $dateRestriction) {
            $query['numericFilters'] .= ','.
                $dateRestriction['dateFieldName'].
                $dateRestriction['operation'].
                $dateRestriction['date']->getTimeStamp();
        }

        foreach ($this->numericFilters as $filter) {
            $query['numericFilters'] .= ','.$filter;
        }

        foreach ($this->facets as $facet) {
            $query['facetFilters'] .= ','.$facet;
        }

        $query['page'] = $this->page;
        $query['hitsPerPage'] = $this->hitsPerPage;

        return $query;
    }
public function toArray()
    {
        $query = [
            'numericFilters' => '',
            'facetFilters'   => '',
        ];

        if ($this->query != '') {
            $query['query'] = $this->query;
        }

        if ($this->useLocationAwareSearch) {
            $query['aroundLatLng'] = $this->lat.','.$this->lng;
            $query['aroundRadius'] = $this->aroundRadius;
        }

        foreach ($this->dateRestrictions as $dateRestriction) {
            $query['numericFilters'] .= ','.
                $dateRestriction['dateFieldName'].
                $dateRestriction['operation'].
                $dateRestriction['date']->getTimeStamp();
        }

        foreach ($this->numericFilters as $filter) {
            $query['numericFilters'] .= ','.$filter;
        }

        foreach ($this->facets as $facet) {
            $query['facetFilters'] .= ','.$facet;
        }

        $query['page'] = $this->page;
        $query['hitsPerPage'] = $this->hitsPerPage;

        return $query;
    }
public function toArray ( ) { $ query = [ 'numericFilters' => '' , 'facetFilters' => '' , ] ; if ( $ this -> query != '' ) { $ query [ 'query' ] = $ this -> query ; } if ( $ this -> useLocationAwareSearch ) { $ query [ 'aroundLatLng' ] = $ this -> lat . ',' . $ this -> lng ; $ query [ 'aroundRadius' ] = $ this -> aroundRadius ; } foreach ( $ this -> dateRestrictions as $ dateRestriction ) { $ query [ 'numericFilters' ] .= ',' . $ dateRestriction [ 'dateFieldName' ] . $ dateRestriction [ 'operation' ] . $ dateRestriction [ 'date' ] -> getTimeStamp ( ) ; } foreach ( $ this -> numericFilters as $ filter ) { $ query [ 'numericFilters' ] .= ',' . $ filter ; } foreach ( $ this -> facets as $ facet ) { $ query [ 'facetFilters' ] .= ',' . $ facet ; } $ query [ 'page' ] = $ this -> page ; $ query [ 'hitsPerPage' ] = $ this -> hitsPerPage ; return $ query ; }
Get the query as an array.

@return array
Get the query as an array .