termRepository = $termRepository; } public function createAction($terms, $categoryObj, $typeObj, $urlObj): void { foreach ($terms as $term) { if($term !== '' && !($this->termRepository->findByTitle($term))) { $termObj = new Term(); $termObj->setTerm($term); $termObj->setCategory($categoryObj); $termObj->setType($typeObj); $termObj->setUrl($urlObj); $this->termRepository->add($termObj); } } } public function deleteAction(int $termId): void { $term = $this->termRepository->findByUid($termId); if ($term) { $this->termRepository->remove($term); } } }