| 1 |
<?php |
| 2 |
|
| 3 |
namespace Mgleis\DiskUsageInsights\Domain\Jobs; |
| 4 |
|
| 5 |
use Mgleis\DiskUsageInsights\Domain\FileEntryRepository; |
| 6 |
use Mgleis\DiskUsageInsights\Domain\SnapshotRepository; |
| 7 |
use Mgleis\PhpSqliteJobQueue\Queue; |
| 8 |
|
| 9 |
class BaseJob { |
| 10 |
protected Queue $queue; |
| 11 |
protected FileEntryRepository $fileEntryRepository; |
| 12 |
protected SnapshotRepository $snapshotRepository; |
| 13 |
|
| 14 |
public function setQueue(Queue $q) { |
| 15 |
$this->queue = $q; |
| 16 |
} |
| 17 |
|
| 18 |
public function setFileEntryRepository(FileEntryRepository $fileEntryRepository) { |
| 19 |
$this->fileEntryRepository = $fileEntryRepository; |
| 20 |
} |
| 21 |
|
| 22 |
public function setSnapshotRepository(SnapshotRepository $snapshotRepository) { |
| 23 |
$this->snapshotRepository = $snapshotRepository; |
| 24 |
} |
| 25 |
|
| 26 |
protected function log(string $s) { |
| 27 |
echo $s."\n"; |
| 28 |
//error_log($s); |
| 29 |
} |
| 30 |
|
| 31 |
public function toDescription(): string { |
| 32 |
return static::class; |
| 33 |
} |
| 34 |
|
| 35 |
} |
| 36 |
|