termRepository = $termRepository; $this->categoryRepository = $categoryRepository; $this->categoryController = $categoryController; $this->termController = $termController; $this->typeRepository = $typeRepository; $this->typeController = $typeController; $this->urlRepository = $urlRepository; $this->urlController = $urlController; } public function indexAction(): void { $terms = $this->termRepository->findAllOrderedByTerm(); $categories = $this->categoryRepository->findAll(); $types = $this->typeRepository->findAll(); $urls = $this->urlRepository->findAll(); $this->view->assignMultiple([ 'terms' => $terms, 'categories' => $categories, 'types' => $types, 'urls' => $urls ]); } 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, string $urlTitle): 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); $url = $this->urlController->createAction($urlTitle); $urlObj = $this->urlRepository->findByUid($url); $this->termController->createAction($terms, $categoryObj, $typeObj, $urlObj); $this->redirect('index'); } public function deleteTermAction(int $termId): void { $this->termController->deleteAction($termId); $this->redirect('index'); } }