本文整理汇总了PHP中Invitation::validateInvitationForm方法的典型用法代码示例。如果您正苦于以下问题:PHP Invitation::validateInvitationForm方法的具体用法?PHP Invitation::validateInvitationForm怎么用?PHP Invitation::validateInvitationForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Invitation
的用法示例。
在下文中一共展示了Invitation::validateInvitationForm方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_invitation_create
public function action_invitation_create()
{
$login = Session::getLogin();
$type = Arr::init($_REQUEST, 'type', TYPE_INT);
if ($login->getType() < $type || $type < \Member::TYPE_MEMBER || $type > $login->getType() || $login->getFundsLevel() != \Member::FUNDS_LEVEL2) {
throw new PermissionDeniedException();
}
if ($type === \Member::TYPE_SUB_PROMOTER) {
list($valid, $data, $recipient) = \Invitation::validateInvitationForm($_REQUEST);
if ($valid !== true) {
return ControllerDispatcher::renderModuleView(self::MODULE_NAME, 'index', ['member' => $login, 'tab' => 'invitation', 'formErrors' => $data, 'recipient' => $recipient, 'formVal' => $_REQUEST]);
}
if ($data['promoter_id'] === '') {
$data['promoter_id'] = $recipient->getId();
return ControllerDispatcher::renderModuleView(self::MODULE_NAME, 'index', ['member' => $login, 'tab' => 'invitation', 'formVal' => $data, 'recipient' => $recipient]);
}
} else {
$data = \Invitation::initInvitationForm($_REQUEST);
}
\Invitation::create($login, $data, \Propel::getConnection());
return ControllerDispatcher::renderModuleView(self::MODULE_NAME, 'index', ['member' => $login, 'tab' => 'invitation', 'successmsg' => true, 'formVal' => []]);
}