| @@ 93-103 (lines=11) @@ | ||
| 90 | * @throws InvalidPathException |
|
| 91 | * @throws NotFoundException |
|
| 92 | */ |
|
| 93 | public function onNewFile(array $params) { |
|
| 94 | $path = $this->get('path', $params, ''); |
|
| 95 | if ($path === '') { |
|
| 96 | return; |
|
| 97 | } |
|
| 98 | ||
| 99 | $file = $this->filesService->getFileFromPath($this->userId, $path); |
|
| 100 | $this->fullTextSearchManager->createIndex( |
|
| 101 | 'files', (string)$file->getId(), $this->userId, IIndex::INDEX_FULL |
|
| 102 | ); |
|
| 103 | } |
|
| 104 | ||
| 105 | ||
| 106 | /** |
|
| @@ 150-163 (lines=14) @@ | ||
| 147 | * @throws InvalidPathException |
|
| 148 | * @throws NotFoundException |
|
| 149 | */ |
|
| 150 | public function onFileTrash(array $params) { |
|
| 151 | // check if trashbin does not exist. -> onFileDelete |
|
| 152 | // we do not index trashbin |
|
| 153 | ||
| 154 | $path = $this->get('path', $params, ''); |
|
| 155 | if ($path === '') { |
|
| 156 | return; |
|
| 157 | } |
|
| 158 | ||
| 159 | $file = $this->filesService->getFileFromPath($this->userId, $path); |
|
| 160 | $this->fullTextSearchManager->updateIndexStatus( |
|
| 161 | 'files', (string)$file->getId(), IIndex::INDEX_REMOVE, true |
|
| 162 | ); |
|
| 163 | } |
|
| 164 | ||
| 165 | ||
| 166 | /** |
|