当前位置: 首页>>代码示例>>PHP>>正文


PHP Invitation::initInvitationForm方法代码示例

本文整理汇总了PHP中Invitation::initInvitationForm方法的典型用法代码示例。如果您正苦于以下问题:PHP Invitation::initInvitationForm方法的具体用法?PHP Invitation::initInvitationForm怎么用?PHP Invitation::initInvitationForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Invitation的用法示例。


在下文中一共展示了Invitation::initInvitationForm方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: create

 public static function create(Member $login, array $data, PropelPDO $con)
 {
     $formData = \Invitation::initInvitationForm($data);
     $invitationsCount = InvitationQuery::create()->count();
     $hash = \Tbmt\Cryption::getInvitationHash($login, $formData['type'], $invitationsCount . time());
     $invitation = new Invitation();
     $invitation->setHash($hash)->setMemberId($login->getId())->setType($formData['type'])->setFreeSignup($formData['free_signup'] ? 1 : 0)->setCreationDate(time())->save($con);
     return $invitation;
 }
开发者ID:nikonehauser,项目名称:pt,代码行数:9,代码来源:Invitation.php

示例2: render

 public function render(array $params = array())
 {
     if (!isset($params['member']) && !$params['member'] instanceof \Member) {
         throw new \Exception('Invalid param member for account index view.');
     }
     $this->member = $params['member'];
     $this->formVal = \Invitation::initInvitationForm(isset($params['formVal']) ? $params['formVal'] : $_REQUEST);
     $this->formErrors = isset($params['formErrors']) ? $params['formErrors'] : [];
     $this->invitations = \InvitationQuery::create()->filterByMemberId($this->member->getId())->orderBy('AcceptedDate', \Criteria::DESC)->orderBy('CreationDate', \Criteria::DESC)->limit(100)->find();
     $this->invitationDateFormat = \Tbmt\Localizer::get('datetime_format_php.long');
     return $this->renderFile(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'tab.invitation.account.html', $params);
 }
开发者ID:nikonehauser,项目名称:pt,代码行数:12,代码来源:account.invitation.tab.view.php

示例3: 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' => []]);
 }
开发者ID:nikonehauser,项目名称:ptclient,代码行数:22,代码来源:account.controller.php


注:本文中的Invitation::initInvitationForm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。