entityType = $entityType; $this->entityFactory = $entityFactory; $this->seed = $this->entityFactory->create($entityType); $this->entityClassName = get_class($this->seed); $this->entityManager = $entityManager; } protected function getEntityFactory() : EntityFactory { return $this->entityFactory; } protected function getEntityManager() : EntityManager { return $this->entityManager; } public function getEntityType() : string { return $this->entityType; } /** * Get entity. If $id is NULL, a new entity is returned. */ abstract public function get(?string $id = null) : ?Entity; /** * Store entity. */ abstract public function save(Entity $entity); }