/**
  * @param LifecycleEventArgs $args
  */
 public function preRemove(LifecycleEventArgs $args)
 {
     $entity = $args->getDocument();
     try {
         $this->solrFacade->removeDocument($entity);
     } catch (\RuntimeException $e) {
     }
 }
 /**
  * @param LifecycleEventArgs $args
  */
 public function postUpdate(LifecycleEventArgs $args)
 {
     $entity = $args->getEntity();
     try {
         $this->solrFacade->updateDocument($entity);
     } catch (\RuntimeException $e) {
     }
 }
Exemplo n.º 3
0
 /**
  * @param LifecycleEventArgs $args
  */
 public function postPersist(LifecycleEventArgs $args)
 {
     $entity = $args->getDocument();
     try {
         $this->solrFacade->addDocument($entity);
     } catch (\RuntimeException $e) {
     }
 }
Exemplo n.º 4
0
 public function findBy(array $args)
 {
     $query = $this->solr->createQuery($this->entity);
     foreach ($args as $fieldName => $fieldValue) {
         $query->addSearchTerm($fieldName, $fieldValue);
     }
     return $this->solr->query($query);
 }
Exemplo n.º 5
0
 public function testAddEntity_FilteredEntityWithUnknownCallback()
 {
     $this->eventManager->expects($this->never())->method('handle');
     $information = new MetaInformation();
     $information->setSynchronizationCallback('shouldBeIndex');
     $this->setupMetaFactoryLoadOneCompleteInformation($information);
     $solr = new SolrFacade($this->connectionFactory, $this->commandFactory, $this->eventManager, $this->metaFactory);
     try {
         $solr->addDocument(new InvalidTestEntityFiltered());
         $this->fail('BadMethodCallException expected');
     } catch (\BadMethodCallException $e) {
         $this->assertTrue(true);
     }
 }
Exemplo n.º 6
0
 /**
  * @return array
  */
 public function getResult()
 {
     return $this->solrFacade->query($this);
 }