Renamed domain RepositoryManagement to Repository

This commit is contained in:
Kevin Frantz
2019-05-30 16:30:03 +02:00
parent aedcdc7af3
commit 78fd41420b
16 changed files with 21 additions and 21 deletions

View File

@@ -0,0 +1,38 @@
<?php
namespace Infinito\Domain\Repository;
use Infinito\Repository\RepositoryInterface;
use Doctrine\ORM\EntityManagerInterface;
use Infinito\Domain\Layer\LayerClassMap;
/**
* @author kevinfrantz
*/
final class LayerRepositoryFactoryService implements LayerRepositoryFactoryServiceInterface
{
/**
* @var EntityManagerInterface
*/
private $entityManager;
/**
* @param EntityManagerInterface $entityManager
*/
public function __construct(EntityManagerInterface $entityManager)
{
$this->entityManager = $entityManager;
}
/**
* {@inheritdoc}
*
* @see \Infinito\Domain\Repository\LayerRepositoryFactoryServiceInterface::getRepository()
*/
public function getRepository(string $layer): RepositoryInterface
{
$repositoryClassName = LayerClassMap::getClass($layer);
return $this->entityManager->getRepository($repositoryClassName);
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace Infinito\Domain\Repository;
use Infinito\Repository\RepositoryInterface;
/**
* Offers a fabric to produce entity repositories by layer.
*
* @author kevinfrantz
*/
interface LayerRepositoryFactoryServiceInterface
{
/**
* @param string $layer
*
* @return RepositoryInterface
*/
public function getRepository(string $layer): RepositoryInterface;
}