public function register(stdClass $data) { $this->_profile = Application_Model_User_Profile::create(); $this->_profile->setEmail($data->email); $this->_setBaseData($data); $this->_setPasswords($data); $this->_profile->save(); $this->_login($data->password); $this->_sendEmail(); return $this->_profile; }
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); }