@@ -73,12 +73,12 @@ discard block |
||
| 73 | 73 | * @param LifecycleEventArgs $args |
| 74 | 74 | */ |
| 75 | 75 | public function postPersist(LifecycleEventArgs $args) { |
| 76 | - if(!$this->enableIndexing) return; |
|
| 76 | + if (!$this->enableIndexing) return; |
|
| 77 | 77 | $this->updateEntity($args->getObject(), $args->getObjectManager()); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | public function postFlush(PostFlushEventArgs $eventArgs) { |
| 81 | - if($this->needsFlush) { |
|
| 81 | + if ($this->needsFlush) { |
|
| 82 | 82 | $this->needsFlush = false; |
| 83 | 83 | $eventArgs->getEntityManager()->flush(); |
| 84 | 84 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | * @param LifecycleEventArgs $args |
| 91 | 91 | */ |
| 92 | 92 | public function preRemove(LifecycleEventArgs $args) { |
| 93 | - if(!$this->enableIndexing) return; |
|
| 93 | + if (!$this->enableIndexing) return; |
|
| 94 | 94 | $this->removeEntity($args->getObject(), $args->getObjectManager()); |
| 95 | 95 | } |
| 96 | 96 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | * @param LifecycleEventArgs $args |
| 101 | 101 | */ |
| 102 | 102 | public function postUpdate(LifecycleEventArgs $args) { |
| 103 | - if(!$this->enableIndexing) return; |
|
| 103 | + if (!$this->enableIndexing) return; |
|
| 104 | 104 | $this->updateEntity($args->getObject(), $args->getObjectManager()); |
| 105 | 105 | } |
| 106 | 106 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | protected function updateEntity($entity, ObjectManager $manager) { |
| 129 | 129 | $document = $this->getEntityToDocumentMapper()->createDocument($manager, $entity); |
| 130 | - if($document !== false) { |
|
| 130 | + if ($document !== false) { |
|
| 131 | 131 | $this->getSearchService($manager)->saveDocument($document); |
| 132 | 132 | } |
| 133 | 133 | } |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | */ |
| 139 | 139 | protected function removeEntity($entity, ObjectManager $manager) { |
| 140 | 140 | $document = $this->getEntityToDocumentMapper()->createDocument($manager, $entity); |
| 141 | - if($document !== false) { |
|
| 141 | + if ($document !== false) { |
|
| 142 | 142 | $this->getSearchService($manager)->removeDocument($document); |
| 143 | 143 | } |
| 144 | 144 | } |
@@ -73,7 +73,9 @@ discard block |
||
| 73 | 73 | * @param LifecycleEventArgs $args |
| 74 | 74 | */ |
| 75 | 75 | public function postPersist(LifecycleEventArgs $args) { |
| 76 | - if(!$this->enableIndexing) return; |
|
| 76 | + if(!$this->enableIndexing) { |
|
| 77 | + return; |
|
| 78 | + } |
|
| 77 | 79 | $this->updateEntity($args->getObject(), $args->getObjectManager()); |
| 78 | 80 | } |
| 79 | 81 | |
@@ -90,7 +92,9 @@ discard block |
||
| 90 | 92 | * @param LifecycleEventArgs $args |
| 91 | 93 | */ |
| 92 | 94 | public function preRemove(LifecycleEventArgs $args) { |
| 93 | - if(!$this->enableIndexing) return; |
|
| 95 | + if(!$this->enableIndexing) { |
|
| 96 | + return; |
|
| 97 | + } |
|
| 94 | 98 | $this->removeEntity($args->getObject(), $args->getObjectManager()); |
| 95 | 99 | } |
| 96 | 100 | |
@@ -100,7 +104,9 @@ discard block |
||
| 100 | 104 | * @param LifecycleEventArgs $args |
| 101 | 105 | */ |
| 102 | 106 | public function postUpdate(LifecycleEventArgs $args) { |
| 103 | - if(!$this->enableIndexing) return; |
|
| 107 | + if(!$this->enableIndexing) { |
|
| 108 | + return; |
|
| 109 | + } |
|
| 104 | 110 | $this->updateEntity($args->getObject(), $args->getObjectManager()); |
| 105 | 111 | } |
| 106 | 112 | |