typeRepository = $typeRepository; } public function createAction(string $title) { $type = new Type(); $type->setTitle($title); $this->typeRepository->add($type); $this->objectManager->get(PersistenceManager::class)->persistAll(); return $type->getUid(); } }