/** * @inheritdoc */ public function getAggregations() { if (!isset($this->aggregations)) { $aggregations = parent::getAggregations(); $this->aggregations = $this->transformer->transformAggregations($aggregations['categories']); } return $this->aggregations; }
/** * @param SearchableInterface $searchable the object to search in * @param Query $query the query to search * @param ElasticaToModelTransformerInterface $transformer the transformer for fetching the results */ public function __construct(SearchableInterface $searchable, Query $query, array $options = array(), ElasticaToModelTransformerInterface $transformer) { parent::__construct($searchable, $query, $options); $this->transformer = $transformer; }