本文整理汇总了PHP中Member::validateSignupForm方法的典型用法代码示例。如果您正苦于以下问题:PHP Member::validateSignupForm方法的具体用法?PHP Member::validateSignupForm怎么用?PHP Member::validateSignupForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Member
的用法示例。
在下文中一共展示了Member::validateSignupForm方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testLevelApplyingWithFreeRegistration
public function testLevelApplyingWithFreeRegistration()
{
$sylvheim = Member::getByNum(\SystemStats::ACCOUNT_SYLVHEIM);
$sylvheim_total = new TransactionTotalsAssertions($sylvheim, $this);
/* Setup - This member is set as paid but no money is spread.
* Because this one is just for testing purpose
---------------------------------------------*/
$marketingLeader = DbEntityHelper::createMember($sylvheim, ['Type' => Member::TYPE_MARKETINGLEADER]);
$marketingLeader->reload(self::$propelCon);
$marketingLeader_total = new TransactionTotalsAssertions($marketingLeader, $this);
/* Create invitation
---------------------------------------------*/
$invitation = Invitation::create($marketingLeader, ['type' => Member::TYPE_ORGLEADER, 'free_signup' => 1], self::$propelCon);
/* Create member with created invitation code
---------------------------------------------*/
list($valid, $data, $referralMember, $invitation) = \Member::validateSignupForm(array_merge(self::$singupFormData, ['referral_member_num' => $marketingLeader->getNum(), 'invitation_code' => $invitation->getHash()]));
// Because the marketing leader is level 1 this org leader will be
// transfered to be child of sylvheim
$orgLeader = \Member::createFromSignup($data, $marketingLeader, $invitation, self::$propelCon);
$orgLeader->reload(self::$propelCon);
// Because orgleaders parent has to be sylvhelm, advertising someone first time
// needs to bonus sylvheim
DbEntityHelper::createSignupMember($orgLeader);
// Spread money for creating this last member
$sylvheim_total->add(Transaction::REASON_SYLVHEIM, 1);
$sylvheim_total->add(Transaction::REASON_ADVERTISED_INDIRECT, 1);
// VL_BONUS - because, orgleader was VL first member and got transferred to
// sylvheimm, therefore there is no VL between sylvheim and ol when ol
// inviteds member
$sylvheim_total->add(Transaction::REASON_VL_BONUS, 1);
// marketing leader gets nothing from ol's advertising.
$sylvheim_total->assertTotals();
$marketingLeader_total->assertTotals();
}
示例2: action_signup_submit
public function action_signup_submit()
{
$formErrors = [];
list($valid, $data, $referralMember, $invitation) = \Member::validateSignupForm($_REQUEST);
if ($valid !== true) {
return ControllerDispatcher::renderModuleView(self::MODULE_NAME, 'signup', ['formErrors' => $data]);
}
$con = $con = \Propel::getConnection();
$member = \Member::createFromSignup($data, $referralMember, $invitation, $con);
$member->reload(false, $con);
Session::setLogin($member);
return new ControllerActionRedirect(Router::toModule('account'));
}
示例3: createMemberWithInvitation
public static function createMemberWithInvitation($referrer, $invitationData, $data = [])
{
if (is_numeric($invitationData)) {
$invitationData = ['type' => $invitationData];
}
$data = array_merge(self::$memberInvitation, $data);
/* Create invitation
---------------------------------------------*/
$invitation = Invitation::create($referrer, $invitationData, self::$con);
/* Create member with created invitation code
---------------------------------------------*/
list($valid, $data, $referralMember, $invitation) = \Member::validateSignupForm(array_merge($data, ['referral_member_num' => $referrer->getNum(), 'invitation_code' => $invitation->getHash()]));
$member = \Member::createFromSignup($data, $referrer, $invitation, self::$con);
$member->reload(self::$con);
if (!isset($invitationData['free_signup']) || !$invitationData['free_signup']) {
$member->onReceivedMemberFee(self::$currency, time(), false, self::$con);
}
return $member;
}
示例4: action_confirm_email_registration
public function action_confirm_email_registration()
{
$valid = false;
if (empty($_REQUEST['hash'])) {
throw new PageNotFoundException();
}
$emailValidation = \EmailValidation::validateHash($_REQUEST['hash']);
if (!$emailValidation) {
throw new InvalidDataException('Sorry the provided registration hash is invalid!');
}
list($valid, $data, $referralMember, $invitation) = \Member::validateSignupForm(json_decode($emailValidation->getMeta(), true));
if ($valid !== true) {
throw new \Exception('Doh, something is wrong with the registration data!');
}
$con = \Propel::getConnection();
$member = \Activity::exec(['\\Member', 'activity_createFromSignup'], [$data, $referralMember, $invitation, $con], \Activity::ACT_MEMBER_SIGNUP, null, $referralMember, $con);
$member->reload(false, $con);
Session::setLogin($member);
Session::set(Session::KEY_SIGNUP_MSG, true);
return new ControllerActionRedirect(Router::toModule('account'));
}
示例5: testInvitationCanFreeFromFee
public function testInvitationCanFreeFromFee()
{
// NOTE: This tests what happen if one of my third+ advertisings gets
// deleted due to not paiing fee.
/* Setup
---------------------------------------------*/
DbEntityHelper::setCon(self::$propelCon);
$marketingLeader = DbEntityHelper::createMember(null, ['type' => Member::TYPE_MARKETINGLEADER]);
$marketingLeader->reload(self::$propelCon);
/* Create invitation
---------------------------------------------*/
$invitation = Invitation::create($marketingLeader, ['type' => Member::TYPE_ORGLEADER, 'free_signup' => 1], self::$propelCon);
/* Create member with created invitation code
---------------------------------------------*/
list($valid, $data, $referralMember, $invitation) = \Member::validateSignupForm(array_merge(self::$singupFormData, ['referral_member_num' => $marketingLeader->getNum(), 'invitation_code' => $invitation->getHash()]));
$member = \Member::createFromSignup($data, $marketingLeader, $invitation, self::$propelCon);
$member->reload(self::$propelCon);
/* Assert proper member type
---------------------------------------------*/
$this->assertEquals(Member::TYPE_ORGLEADER, $member->getType());
$this->assertNotNull($member->getPaidDate());
}
示例6: testSubPromoterBonusSpreading
public function testSubPromoterBonusSpreading()
{
// Deprecated
$this->assertTrue(true);
return;
/**
* PM
* 1$
*
* VL - S_PM - Neues Mitglied
* 1$ - 1$ - 5$
* ------------------------------------------*/
/* Setup
---------------------------------------------*/
DbEntityHelper::setCon(self::$propelCon);
$marketingLeader = DbEntityHelper::createMember(null, ['Type' => Member::TYPE_MARKETINGLEADER, 'FundsLevel' => Member::FUNDS_LEVEL2]);
$marketingLeader->reload(self::$propelCon);
$mLeaderTransfer = new TransactionTotalsAssertions($marketingLeader, $this);
$promoter = DbEntityHelper::createSignupMember($marketingLeader);
$mLeaderTransfer->add(Transaction::REASON_ADVERTISED_LVL2);
$mLeaderTransfer->add(Transaction::REASON_VL_BONUS);
$mLeaderTransfer->add(Transaction::REASON_OL_BONUS);
$mLeaderTransfer->add(Transaction::REASON_PM_BONUS);
/* Create invitation
---------------------------------------------*/
$invitation = Invitation::create($marketingLeader, ['type' => Member::TYPE_SUB_PROMOTER, 'free_signup' => 1, 'promoter_num' => $promoter->getNum(), 'promoter_id' => $promoter->getId()], self::$propelCon);
/* Create member with created invitation code
---------------------------------------------*/
list($valid, $data, $referralMember, $invitation) = \Member::validateSignupForm(array_merge(self::$singupFormData, ['referral_member_num' => $marketingLeader->getNum(), 'invitation_code' => $invitation->getHash()]));
$subPromoter = \Member::createFromSignup($data, $marketingLeader, $invitation, self::$propelCon);
$subPromoter->reload(self::$propelCon);
/* Sub promoter recruits anyone
---------------------------------------------*/
DbEntityHelper::createSignupMember($subPromoter);
$subPromoterTransfer = new TransactionTotalsAssertions($subPromoter, $this);
$promoterTransfer = new TransactionTotalsAssertions($promoter, $this);
$mLeaderTransfer->add(Transaction::REASON_VL_BONUS);
$mLeaderTransfer->add(Transaction::REASON_ADVERTISED_INDIRECT);
$promoterTransfer->add(Transaction::REASON_SUB_PM_REF_BONUS);
$subPromoterTransfer->add(Transaction::REASON_SUB_PM_BONUS);
$subPromoterTransfer->add(Transaction::REASON_ADVERTISED_LVL1);
$mLeaderTransfer->assertTotals();
$promoterTransfer->assertTotals();
$subPromoterTransfer->assertTotals();
}