當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。