/** * @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) { } }
/** * @param LifecycleEventArgs $args */ public function postPersist(LifecycleEventArgs $args) { $entity = $args->getDocument(); try { $this->solrFacade->addDocument($entity); } catch (\RuntimeException $e) { } }
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); }
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); } }
/** * @return array */ public function getResult() { return $this->solrFacade->query($this); }