本文整理汇总了PHP中Bookmark::setUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Bookmark::setUser方法的具体用法?PHP Bookmark::setUser怎么用?PHP Bookmark::setUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bookmark
的用法示例。
在下文中一共展示了Bookmark::setUser方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeConfirmEmail
public function executeConfirmEmail($request)
{
// we only accept GET method
$this->forward404Unless($request->isMethod('get'));
$email = EmailPeer::getFromField(EmailPeer::CONFIRM_CODE, $this->getRequestParameter('confirm_code'));
if ($email) {
if ($email->getIsPrimary() && !$email->getActualEmail()) {
// if invited, send acceptance email and add to quick contact
$user = $email->getUser();
if ($user->getInvitedBy()) {
// add to bookmark
$b = new Bookmark();
$b->setUser($user->getUserRelatedByInvitedBy());
$b->setTag($user->retrievePrimaryJotag());
$b->save();
// give credit to the inviter
$credits = $user->getUserRelatedByInvitedBy()->giveCredit(OptionPeer::retrieveOption('BONUS_ACCEPT_CREDIT'));
Mailer::sendEmail($user->getUserRelatedByInvitedBy()->getPrimaryEmail(), 'inviteAccepted', array('owner' => $user->getUserRelatedByInvitedBy(), 'user' => $user, 'email' => $email, 'credits' => $credits), $user->getUserRelatedByInvitedBy()->getPreferedLanguage());
}
// activate primary jotag
$jotag = $email->getUser()->retrievePrimaryJotag();
$jotag->setStatus(TagPeer::ST_ACTIVE);
$jotag->save();
$this->setMessage('ACCOUNT_CONFIRM', 'SUCCESS');
} else {
$this->setMessage('EMAIL_CONFIRM', 'SUCCESS');
}
$email->setIsConfirmed(true);
$email->setConfirmCode(null);
$email->setActualEmail(null);
$email->save();
} else {
$this->setMessage('EMAIL_CONFIRM_ERROR', 'ERROR');
}
$this->redirect('@homepage');
}