eZ\Publish\Core\Search\Elasticsearch\Content\FacetBuilderVisitor\Aggregate::map PHP Method

map() public method

Map Elasticsearch facet result back to facet objects.
public map ( string $name, mixed $data ) : eZ\Publish\API\Repository\Values\Content\Search\Facet
$name string
$data mixed
return eZ\Publish\API\Repository\Values\Content\Search\Facet
    public function map($name, $data)
    {
        foreach ($this->visitors as $visitor) {
            if ($visitor->canMap($name)) {
                return $visitor->map($name, $data);
            }
        }
        throw new OutOfRangeException('No visitor available for: ' . $name);
    }