entityManager = $entityManager; $this->entityFactroy = $entityFactroy; $this->mapper = $mapper; } public function create($name) { $className = $this->entityManager->normalizeRepositoryName($name); if (!class_exists($className)) { $className = $this->defaultRepositoryClassName; } $repository = new $className($name, $this->entityManager, $this->entityFactroy, $this->mapper); return $repository; } protected function normalizeName($name) { return $name; } public function setDefaultRepositoryClassName($defaultRepositoryClassName) { $this->defaultRepositoryClassName = $defaultRepositoryClassName; } }