Example #1
0
 public function save(Application_Model_User $user)
 {
     $data = array('userId' => $user->getUserId(), 'userName' => $user->getUserName(), 'userPassword' => $user->getUserPassword(), 'userRegDate' => $user->getUserReg(), 'userLastLogin' => $user->getUserLastLogin());
     if (null === ($id = $user->getUserId())) {
         unset($data['userId']);
         $this->getDbTable()->insert($data);
     } else {
         $this->getDbTable()->update($data, array('userId = ?' => $userId));
     }
 }
 public function save(Application_Model_User $user)
 {
     $data = array('password' => $user->getPassword(), 'username' => $user->getUserName());
     if (null === ($id = $user->getId())) {
         unset($data['id']);
         $this->getDbTable()->insert($data);
     } else {
         $this->getDbTable()->update($data, array('id = ?' => $id));
     }
 }