mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Renamed domain RepositoryManagement to Repository
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
@@ -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;
|
||||
}
|
Reference in New Issue
Block a user