Esempio n. 1
0
 public function save(App_Model_User $tbl)
 {
     $data = array('credibility' => $tbl->getCredibility(), 'is_active' => $tbl->getIsActive(), 'role_id' => $tbl->getRoleId(), 'email' => $tbl->getEmail(), 'username' => $tbl->getUsername(), 'token' => $tbl->getToken(), 'id' => $tbl->getId());
     if (null === ($id = $tbl->getId())) {
         unset($data['id']);
         $this->getDbTable()->insert($data);
     } else {
         $this->getDbTable()->update($data, array('id = ?' => $id));
     }
 }