Example #1
0
 private function createQueryWithFieldMapping()
 {
     $solr = $this->getMock('FS\\SolrBundle\\SolrFacade', array(), array(), '', false);
     $solrQuery = new SolrQuery($solr);
     $solrQuery->setMappedFields($this->getFieldMapping());
     return $solrQuery;
 }
Example #2
0
 /**
  * @param object $entity
  * @return SolrQuery
  */
 public function createQuery($entity)
 {
     $metaInformation = $this->metaInformationFactory->loadInformation($entity);
     $class = $metaInformation->getClassName();
     $entity = new $class();
     $query = new SolrQuery($this);
     $query->setEntity($entity);
     $command = $this->commandFactory->get('all');
     $query->setMappedFields($metaInformation->getFieldMapping());
     return $query;
 }