Exemplo n.º 1
0
 public function createAction()
 {
     if ($this->getRequest()->isPost()) {
         $this->dashboardForm->setData($this->getRequest()->getPost());
         if ($this->dashboardForm->isValid()) {
             $data = $this->dashboardForm->getData();
             $this->dashboardTaskService->persistFromArray($data);
             return $this->redirect()->toRoute('dashboard/manage');
         }
     }
     return new ViewModel(['dashboardForm' => $this->dashboardForm]);
 }
Exemplo n.º 2
0
 public function create($data)
 {
     $dashboard = $this->dashboardTaskService->persistFromArray((array) $data);
     return new DashboardEntity($dashboard);
 }