public function load() { $this->user->load(); $this->accountUser->set('accountuserid', $this->user->get('accountuserid')); $this->accountUser->load(); $this->authUser->set('authid', $this->accountUser->get('authid')); $this->authUser->load(); }
protected function getCurrentUserId() { $userid = $this->rule->getCondition()->getCurrentUserId(); $user = new Pap_Db_User(); $user->setId($userid); try { $user->load(); } catch (Gpf_Exception $e) { return $userid; } return $user->getOriginalParentUserId(); }
private function validateUser(Pap_Db_User $user) { if ($user->getType() != Pap_Application::ROLETYPE_AFFILIATE) { return; } if ($user->getRefId() == "") { throw new Gpf_DbEngine_Row_ConstraintException(Pap_Db_Table_Users::REFID, $this->_("Referral ID can not be blank")); } if (Gpf_Session::getAuthUser()->isLogged() && Gpf_Session::getAuthUser()->isAffiliate()) { $userTmp = new Pap_Db_User(); $userTmp->setId($user->getId()); try { $userTmp->load(); } catch (Gpf_Exception $e) { return; } if ($userTmp->getRefId() != $user->getRefId()) { throw new Gpf_DbEngine_Row_ConstraintException(Pap_Db_Table_Users::REFID, $this->_("Referral ID can not be changed")); } } }
public function getCurrentUserId() { $user = new Pap_Db_User(); $user->setId($this->rule->getTransaction()->getUserId()); $user->load(); return $user->getParentUserId(); }
/** * @throws Gpf_DbEngine_NoRowException * @throws Gpf_DbEngine_TooManyRowsException * @return Pap_Db_User */ protected function getUser($userId) { $user = new Pap_Db_User(); $user->setId($userId); $user->load(); return $user; }