SimpleController.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace Meramo\Speedbase\Controller;
  3. use Meramo\Begriffmgt\Controller\DashboardController;
  4. use Meramo\Begriffmgt\Domain\Repository\CategoryRepository;
  5. use Meramo\Begriffmgt\Domain\Repository\TypeRepository;
  6. use Meramo\Begriffmgt\Controller\UrlController;
  7. use Meramo\Begriffmgt\Domain\Repository\UrlRepository;
  8. use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
  9. class SimpleController extends ActionController
  10. {
  11. public function __construct(
  12. DashboardController $dashboardController,
  13. CategoryRepository $categoryRepository,
  14. TypeRepository $typeRepository,
  15. UrlRepository $urlRepository,
  16. UrlController $urlController
  17. ){
  18. $this->dashboardController = $dashboardController;
  19. $this->categoryRepository = $categoryRepository;
  20. $this->typeRepository = $typeRepository;
  21. $this->urlRepository = $urlRepository;
  22. $this->urlController = $urlController;
  23. }
  24. public function persistDataToDBAction($termsList, $category, $type, $url){
  25. if(!($category === '') && !($category === null)){
  26. $category = ($this->categoryRepository->findByUid($category))->getTitle();
  27. } else {
  28. $category = '';
  29. }
  30. if(!($type === '') && !($type === null)){
  31. $type = ($this->typeRepository->findByUid($type))->getTitle();
  32. } else {
  33. $type = '';
  34. }
  35. if($url === null){
  36. $url = '';
  37. }
  38. $this->dashboardController->createAction($termsList, $category, $type, $url);
  39. }
  40. }