src/Crud/Controller/proxyPlainController.php line 51

Open in your IDE?
  1. <?php
  2. namespace App\Crud\Controller;
  3. use App\Crud\Controller\crudController;
  4. /**
  5.  * proxyPlainController controller.
  6.  */
  7. class proxyPlainController extends crudController
  8. {
  9.     
  10.     protected function setClassMap($routeClassName)
  11.     {
  12.         $config parent::setClassMap($routeClassName);
  13.         
  14. //        $config = $this->container->getParameter('crudmapping');
  15.         if (isset($config[$routeClassName]) && isset($config[$routeClassName]['controlador']))
  16.         {
  17.             $this->classMap['controlador'] = $config[$routeClassName]['controlador'];
  18.         }
  19.     }   
  20.     
  21.     protected function setControlador()
  22.     {
  23.         if (isset($this->classMap['controlador']))
  24.         {
  25.             $this->controlador $this->classMap['controlador'];  
  26.         }
  27.         else 
  28.         if (!$this->setClassControlador())
  29.         {
  30.             $this->controlador 'App\Crud\Controller\crudPlainController';
  31.         }
  32.     }        
  33.     protected function setClassControlador()
  34.     {
  35.         $root $_SERVER['DOCUMENT_ROOT'];
  36.         $fileName str_replace('/public'''$root);
  37.         $className $this->classMap['className'];
  38.         $fileName $fileName.'/src/Controller/'.$className.'Controller.php';
  39.         if (file_exists($fileName))
  40.         {
  41.             $this->controlador 'App\Controller\\'.$className.'Controller';
  42.             return true;
  43.         }
  44.         
  45.         return false;
  46.     }
  47.     
  48.     public function indexAction($rol$routeClassName)
  49.     {     
  50.         $this->setInitialValues($rol$routeClassName);
  51. //        $this->params['routeClassName'] = $routeClassName;
  52.         return $this->forward($this->controlador.'::indexAction'$this->params);
  53.     }
  54.     
  55.     public function newAction($rol$routeClassName)
  56.     {
  57.         $this->setInitialValues($rol$routeClassName);
  58. //        $this->params['routeClassName'] = $routeClassName;
  59. //        $this->params['accion'] = $accion;
  60.         return $this->forward($this->controlador.'::newAction'$this->params);
  61.     }
  62.     public function createAction($rol$routeClassName)
  63.     {
  64.         $this->setInitialValues($rol$routeClassName);
  65. //        $this->params['routeClassName'] = $routeClassName;
  66. //        $this->params['accion'] = $accion;
  67.         return $this->forward($this->controlador.'::createAction'$this->params);
  68.     }
  69.     
  70.     public function backToListAction($rol$routeClassName$id)
  71.     {
  72.         $this->setInitialValues($rol$routeClassName);
  73. //        $this->params['routeClassName'] = $routeClassName;
  74. //        $this->params['id'] = $id;
  75.         return $this->forward($this->controlador.'::backToListAction'$this->params);
  76.     }
  77.     
  78.     public function showAction($rol$id$routeClassName$tab=-1)
  79.     {
  80.         $this->setInitialValues($rol$routeClassName);
  81. //        $this->params['routeClassName'] = $routeClassName;
  82. //        $this->params['id'] = $id;
  83.         $this->params['tab']=$tab;
  84.         return $this->forward($this->controlador.'::showAction'$this->params);
  85.     }
  86.     
  87.     public function editAction($rol$id$routeClassName)
  88.     {
  89.         $this->setInitialValues($rol$routeClassName);
  90. //        $this->params['routeClassName'] = $routeClassName;
  91. //        $this->params['id'] = $id;
  92. //        $this->params['accion'] = $accion;
  93.         return $this->forward($this->controlador.'::editAction'$this->params);
  94.     }
  95.     public function updateAction($rol$id$routeClassName)
  96.     {
  97.         $this->setInitialValues($rol$routeClassName);
  98. //        $this->params['routeClassName'] = $routeClassName;
  99. //        $this->params['id'] = $id;
  100. //        $this->params['accion'] = $accion;
  101.         return $this->forward($this->controlador.'::updateAction'$this->params);
  102.     }
  103.     
  104.     public function deleteAction($rol$id$routeClassName)
  105.     {
  106.         $this->setInitialValues($rol$routeClassName);
  107. //        $this->params['routeClassName'] = $routeClassName;
  108. //        $this->params['rol'] = $rol;
  109. //        $this->params['id'] = $id;
  110.         return $this->forward($this->controlador.'::deleteAction'$this->params);
  111.     }
  112.     
  113.     public function paginatorAction($rol$routeClassName$page)
  114.     {
  115.         $this->setInitialValues($rol$routeClassName);
  116. //        $this->params['routeClassName'] = $routeClassName;
  117. //        $this->params['page'] = $page;
  118.         return $this->forward($this->controlador.'::paginator'$this->params);
  119.     }
  120.     
  121. }