@@ -107,12 +107,14 @@ |
||
| 107 | 107 | * @see \StingerSoft\EntitySearchBundle\Services\Mapping\EntityToDocumentMapperInterface::createDocument() |
| 108 | 108 | */ |
| 109 | 109 | public function createDocument(ObjectManager $manager, object $object) : ?Document { |
| 110 | - if(!$this->isIndexable($object)) |
|
| 111 | - return null; |
|
| 110 | + if(!$this->isIndexable($object)) { |
|
| 111 | + return null; |
|
| 112 | + } |
|
| 112 | 113 | $document = $this->searchService->createEmptyDocumentFromEntity($object); |
| 113 | 114 | $index = $this->fillDocument($document, $object); |
| 114 | - if($index === false) |
|
| 115 | - return null; |
|
| 115 | + if($index === false) { |
|
| 116 | + return null; |
|
| 117 | + } |
|
| 116 | 118 | |
| 117 | 119 | return $document; |
| 118 | 120 | } |
@@ -141,7 +141,9 @@ |
||
| 141 | 141 | * @param LifecycleEventArgs $args |
| 142 | 142 | */ |
| 143 | 143 | public function postUpdate(LifecycleEventArgs $args): void { |
| 144 | - if (!$this->enableIndexing) return; |
|
| 144 | + if (!$this->enableIndexing) { |
|
| 145 | + return; |
|
| 146 | + } |
|
| 145 | 147 | $this->updateEntity($args->getObject(), $args->getObjectManager()); |
| 146 | 148 | } |
| 147 | 149 | |