Advertisement
roniewill

categories_methods

Aug 17th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.59 KB | None | 0 0
  1.   public function addCategoria()
  2.     {
  3.         if($this->_request->isPost()){
  4.             $id_usuario = $this->currentUserLogged->id;
  5.             $nome = $this->_getParam('categoria-nome');
  6.             $data = ['id_usuario'=>$id_usuario, 'nome'=>$nome];
  7.             $newRow = $this->usuarioSiteCategoria->createRow($data);
  8.             $newRow->save();
  9.             $this->_redirector->gotoRoute([], 'rota_office_builder');
  10.         }
  11.     }
  12.  
  13.     public function getAllCategoriesByUser()
  14.     {
  15.         $id_usuario = $this->currentUserLogged->id;
  16.         return $this->usuarioSiteCategoria->getAllById($id_usuario);
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement