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