code: private function getFacetParams(array $facetBuilders)
      {
          $facetSets = array_map(
              function ($facetBuilder) {
                  return $this->facetBuilderVisitor->visitBuilder($facetBuilder, spl_object_hash($facetBuilder));
              },
              $facetBuilders
          );
  
          $facetParams = array();
  
          // In case when facet sets contain same keys, merge them in an array
          foreach ($facetSets as $facetSet) {
              foreach ($facetSet as $key => $value) {
                  if (isset($facetParams[$key])) {
                      if (!is_array($facetParams[$key])) {
                          $facetParams[$key] = array($facetParams[$key]);
                      }
                      $facetParams[$key][] = $value;
                  } else {
                      $facetParams[$key] = $value;
                  }
              }
          }
  
          return $facetParams;
      }
docs: Converts an array of facet builder objects to a Solr query parameters representation.
  
  This method uses spl_object_hash() to get id of each and every facet builder, as this
  is expected by {@link \EzSystems\EzPlatformSolrSearchEngine\ResultExtractor}.
  
  @param \eZ\Publish\API\Repository\Values\Content\Query\FacetBuilder[] $facetBuilders
  
  @return array