本文整理匯總了PHP中Invitation::setHash方法的典型用法代碼示例。如果您正苦於以下問題:PHP Invitation::setHash方法的具體用法?PHP Invitation::setHash怎麽用?PHP Invitation::setHash使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Invitation
的用法示例。
在下文中一共展示了Invitation::setHash方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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;
}
示例2: create
public static function create(Member $login, array $data, PropelPDO $con)
{
$type = $data['type'];
$hash = SystemStats::getIncreasedInvitationIncrementer($con);
$invitation = new Invitation();
if ($type === \Member::TYPE_SUB_PROMOTER) {
$invitation->setMeta(['promoter_num' => $data['promoter_num'], 'promoter_id' => $data['promoter_id']]);
}
$invitation->setHash($hash)->setMemberId($login->getId())->setType($type)->setFreeSignup(isset($data['free_signup']) && $data['free_signup'] ? 1 : 0)->setCreationDate(time())->save($con);
return $invitation;
}