/** * @return SolrQuery */ private function createQueryWithFieldMapping() { $solr = $this->getMock('FS\\SolrBundle\\Solr', array(), array(), '', false); $solrQuery = new SolrQuery(); $solrQuery->setSolr($solr); $solrQuery->setMappedFields($this->getFieldMapping()); return $solrQuery; }
/** * @param object $entity * * @return SolrQuery */ public function createQuery($entity) { $metaInformation = $this->metaInformationFactory->loadInformation($entity); $class = $metaInformation->getClassName(); $entity = new $class(); $query = new SolrQuery(); $query->setSolr($this); $query->setEntity($entity); $query->setIndex($metaInformation->getIndex()); $query->setMappedFields($metaInformation->getFieldMapping()); return $query; }