orm refactoring

This commit is contained in:
Yuri Kuznetsov
2021-04-22 17:58:06 +03:00
parent 811e5479f4
commit a6f3c879a5
5 changed files with 153 additions and 58 deletions
@@ -44,18 +44,13 @@ abstract class Repository
protected $entityManager;
protected $seed;
protected $entityType;
public function __construct(string $entityType, EntityManager $entityManager, EntityFactory $entityFactory)
{
$this->entityType = $entityType;
$this->entityFactory = $entityFactory;
$this->entityManager = $entityManager;
$this->seed = $this->entityFactory->create($entityType);
}
protected function getEntityFactory(): EntityFactory