termRepository = $termRepository; $this->categoryRepository = $categoryRepository; $this->categoryController = $categoryController; $this->termController = $termController; $this->typeRepository = $typeRepository; $this->typeController = $typeController; } public function indexAction(): void { $terms = $this->termRepository->findAll(); $categories = $this->categoryRepository->findAll(); $this->view->assignMultiple([ 'terms' => $terms, 'categories' => $categories, ]); } public function newAction(): void { } public function listAction(): void { $terms = $this->termRepository->findAll(); $this->view->assign('terms', $terms); } public function createAction(string $termList, string $categoryTitle, string $typeTitle): void { $terms = array_map('trim', explode(',', $termList)); $category = $this->categoryController->createAction($categoryTitle); $categoryObj = $this->categoryRepository->findByUid($category); $type = $this->typeController->createAction($typeTitle); $typeObj = $this->typeRepository->findByUid($type); $this->termController->createAction($terms, $categoryObj, $typeObj); $this->redirect('index'); } }