/** * @param DataSourceInterface $dataSource */ public function addDataSource(DataSourceInterface $dataSource) { $name = $dataSource->getName(); $this->dataSources[$name] = $dataSource; }
/** * Attach a data source implementing DataSourceInterface. This source will be queried each * time the Facet is computed to match the resulting IDs with string terms. * * @param DataSourceInterface $datasource Data source object. * @param array $options Source configuration options. */ public function attachDataSource(DataSourceInterface $datasource, array $options = null) { $this->_datasource = $datasource; if ($options) { $this->setSource($options); } // if attaching a Facet to itself, add the source attribute to the Sphinx selection if ($datasource instanceof Facet && $datasource->getName() === $this->getName()) { $this->_set_select .= ', ' . $this->_source['name']; } }