Esempio n. 1
0
 /**
  * Save entity
  *
  * @param Auth_Model_Role $role
  */
 public function save(Auth_Model_Role $role)
 {
     $data = array();
     $data = $role->toArray();
     //        $this->_populateDataArr($data, $user, array('id','code','title',
     //            'content','application_id'));
     $id = $role->get_id();
     if (!isset($id) || $id <= 0) {
         unset($data['id']);
         $id = $this->_dbTable->insert($data);
         $role->set_id($id);
     } else {
         $this->_dbTable->update($data, array('id = ?' => $id));
     }
 }