public function update(Application_Model_User_Profile $profile, stdClass $data) { $this->_profile = $profile; $this->_uploadAvatar($data->idAvatar); $this->_setBaseData($data); $this->_profile->setPhone($data->userPhone); $this->_profile->setAddress($data->address); if (!empty($data->password)) { $this->_setPasswords($data); } $this->_profile->save(); }
public function editAction() { parent::editAction(); if ($this->getRequest()->isPost()) { try { $data = (object) $this->getRequest()->getPost(); /* @var stdClass $data */ $this->_setData($data); $this->_entity->save(); $this->__goBack(); } catch (Exception $e) { $this->view->showMessage($e); } } else { $_POST['passwd'] = ''; $_POST['email'] = $this->_entity->getEmail(); $_POST['id_avatar'] = $this->_entity->getIdAvatar(); $_POST['phone'] = $this->_entity->getPhone()->getPhoneNumber(); $_POST['user_name'] = $this->_entity->getName(); $_POST['last_name'] = $this->_entity->getLastname(); } }