Skip to content

Commit

Permalink
Upgdate ServiceContainer (UniqueLink).
Browse files Browse the repository at this point in the history
  • Loading branch information
zerai committed Dec 13, 2021
1 parent 4fc7253 commit 2106c87
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions core/ingesting/src/PublicJob/Infrastructure/ServiceContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use Ingesting\PublicJob\Application\Model\Iso\RssReader;
use Ingesting\PublicJob\Application\Model\JobRepository;
use Ingesting\PublicJob\Application\Model\Service\JobUniqueService;
use Ingesting\PublicJob\Application\Model\Service\UniqueJobLinkService;
use Ingesting\PublicJob\Application\Model\Service\UniqueLink;
use Ingesting\PublicJob\Application\PublicJobContextInterface;
use Ingesting\PublicJob\Application\PublicJobModule;
use Ingesting\PublicJob\Application\Usecase\JobRssDataSourceChecker;
Expand All @@ -20,6 +22,8 @@ abstract class ServiceContainer

protected ?JobUniqueService $jobUniqueService = null;

protected ?UniqueJobLinkService $uniqueJobLinkService = null;

protected ?JobRssDataSourceChecker $readJobRssUsecase = null;

protected ?RssReader $jobRssReader = null;
Expand Down Expand Up @@ -52,6 +56,15 @@ public function jobUniqueService(): JobUniqueService
return $this->jobUniqueService;
}

protected function uniqueJobLinkService(): UniqueLink
{
if ($this->uniqueJobLinkService === null) {
$this->uniqueJobLinkService = new UniqueJobLinkService($this->jobRepository());
}

return $this->uniqueJobLinkService;
}

protected function jobRepository(): JobRepository
{
if ($this->jobRepository === null) {
Expand All @@ -67,6 +80,7 @@ protected function readJobRssUsecase(): JobRssDataSourceChecker
$this->readJobRssUsecase = new ReadJobRssUsecase(
$this->jobRssReader(),
$this->jobUniqueService(),
$this->uniqueJobLinkService(),
$this->jobRepository()
);
}
Expand Down

0 comments on commit 2106c87

Please sign in to comment.