Skip to content

Commit

Permalink
Update pjob ProductionServiceContainer.
Browse files Browse the repository at this point in the history
  • Loading branch information
zerai committed Dec 7, 2021
1 parent 018417f commit ed07ea5
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@

namespace Ingesting\PublicJob\Infrastructure;

use Ingesting\PublicJob\Adapter\Persistence\InMemoryJobFeedRepository;
use Ingesting\PublicJob\Application\Model\JobRepository;

class ProductionServiceContainer extends ServiceContainer
{
protected ?JobRepository $jobRepository = null;

public function __construct(?JobRepository $jobRepository = null)
{
$this->jobRepository = $jobRepository;
}

protected function jobRepository(): JobRepository
{
if ($this->jobRepository === null) {
/**
* Todo remove InMemoryJobFeedRepository
* add Doctrine repository
*/
$this->jobRepository = new InMemoryJobFeedRepository();
}

return $this->jobRepository;
}
}

0 comments on commit ed07ea5

Please sign in to comment.