|
@@ -0,0 +1,36 @@
|
|
|
|
|
+<?php
|
|
|
|
|
+
|
|
|
|
|
+namespace Meramo\Speedbase\Controller;
|
|
|
|
|
+
|
|
|
|
|
+use Meramo\Begriffmgt\Controller\DashboardController;
|
|
|
|
|
+use Meramo\Begriffmgt\Domain\Repository\CategoryRepository;
|
|
|
|
|
+use Meramo\Begriffmgt\Domain\Repository\TypeRepository;
|
|
|
|
|
+use Meramo\Begriffmgt\Domain\Repository\UrlRepository;
|
|
|
|
|
+use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
|
|
|
|
+
|
|
|
|
|
+class SimpleController extends ActionController
|
|
|
|
|
+{
|
|
|
|
|
+ public function __construct(
|
|
|
|
|
+ DashboardController $dashboardController,
|
|
|
|
|
+ CategoryRepository $categoryRepository,
|
|
|
|
|
+ TypeRepository $typeRepository,
|
|
|
|
|
+ UrlRepository $urlRepository
|
|
|
|
|
+ ){
|
|
|
|
|
+ $this->dashboardController = $dashboardController;
|
|
|
|
|
+ $this->categoryRepository = $categoryRepository;
|
|
|
|
|
+ $this->typeRepository = $typeRepository;
|
|
|
|
|
+ $this->urlRepository = $urlRepository;
|
|
|
|
|
+ }
|
|
|
|
|
+ public function persistDataToDBAction($termsList, $category, $type, $url){
|
|
|
|
|
+ if(!($category === '')){
|
|
|
|
|
+ $category = ($this->categoryRepository->findByUid($category))->getTitle();
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!($type === '')){
|
|
|
|
|
+ $type = ($this->typeRepository->findByUid($type))->getTitle();
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!($url === '')){
|
|
|
|
|
+ $url = ($this->urlRepository->findByUid($url))->getTitle();
|
|
|
|
|
+ }
|
|
|
|
|
+ $this->dashboardController->createAction($termsList, $category, $type, $url);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|