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(); }
private function _setData(stdClass $data) { $this->_entity->setEmail($data->email); if (!empty($data->passwd)) { $this->_entity->setPassword($data->passwd); } if (isset($data->id_avatar) && intval($data->id_avatar) !== 0) { $photo = RM_Photo::getById($data->id_avatar); if ($photo instanceof RM_Photo) { $this->_entity->setAvatar($photo); } } $this->_entity->setName($data->user_name); $this->_entity->setLastname($data->last_name); $this->_entity->setPhone($data->phone); }