Exemplo n.º 1
0
 /**
  * Save user data
  * 
  * @param User_Model_User $user
  */
 public function save(User_Model_User $user)
 {
     $data = array('email' => $user->getEmail(), 'firstname' => $user->getFirstname(), 'lastname' => $user->getLastname(), 'address' => $user->getAddress(), 'phone' => $user->getPhone(), 'country' => $user->getCountry());
     if (($id = $user->getId()) != 0 && $id != '') {
         return $this->getDbTable()->update($data, 'id=' . $id);
     } else {
         return $this->getDbTable()->insert($data);
     }
 }
Exemplo n.º 2
0
 public function delete()
 {
     if ($this->_isAllowed()) {
         $user = $this->getUser();
         try {
             $u = new User_Persist_Dao_User();
             return $u->delete($this->_user->getId());
         } catch (Exception $e) {
             throw $e;
         }
     }
 }
Exemplo n.º 3
0
<?php
Exemplo n.º 4
0
 /**
  * Update user data
  * @param User_Model_User $user 
  */
 private function _update($user)
 {
     if ($user != null) {
         try {
             $where = $this->getAdapter()->quoteInto('id = ?', $user->getId());
             return $this->getAdapter()->update('user', $this->_prepareUpdateData($user), $where);
         } catch (Exception $pdoe) {
             throw new Agana_Exception($pdoe->getMessage());
         }
     }
 }
Exemplo n.º 5
0
<?php