| Conditions | 2 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 35 | public function run(array $payload, array $options = []): bool |
||
| 36 | { |
||
| 37 | $handler = new CollectionHandler(); |
||
| 38 | try { |
||
| 39 | $collection = $this->fetchTable('Collections')->get($payload['collection_id']); |
||
| 40 | $file = $this->fetchTable('Files')->get($payload['file_id']); |
||
| 41 | $handler->uploadDocument($collection, $file); |
||
| 42 | |||
| 43 | return true; |
||
| 44 | } catch (Throwable $th) { |
||
| 45 | $this->log(sprintf('IndexFile async job error - %s', $th->getMessage()), 'error'); |
||
| 46 | } |
||
| 47 | |||
| 48 | return false; |
||
| 49 | } |
||
| 51 |