本文整理汇总了PHP中Invitation::query方法的典型用法代码示例。如果您正苦于以下问题:PHP Invitation::query方法的具体用法?PHP Invitation::query怎么用?PHP Invitation::query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Invitation
的用法示例。
在下文中一共展示了Invitation::query方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle
/**
* Handle the site
*
* @param array $remitem type of reminder to send and any special options
* @return boolean true on success, false on failure
*/
function handle($remitem)
{
list($type, $opts) = $remitem;
$qm = QueueManager::get();
try {
switch ($type) {
case UserConfirmRegReminderHandler::REGISTER_REMINDER:
$confirm = new Confirm_address();
$confirm->address_type = $type;
$confirm->find();
while ($confirm->fetch()) {
try {
$qm->enqueue(array($confirm, $opts), 'uregrem');
} catch (Exception $e) {
common_log(LOG_WARNING, $e->getMessage());
continue;
}
}
break;
case UserInviteReminderHandler::INVITE_REMINDER:
$invitation = new Invitation();
// Only send one reminder (the latest one), regardless of how many invitations a user has
$sql = 'SELECT * FROM (SELECT * FROM invitation WHERE registered_user_id IS NULL ORDER BY created DESC) invitees GROUP BY invitees.address';
$invitation->query($sql);
while ($invitation->fetch()) {
try {
$qm->enqueue(array($invitation, $opts), 'uinvrem');
} catch (Exception $e) {
common_log(LOG_WARNING, $e->getMessage());
continue;
}
}
break;
default:
// WTF?
common_log(LOG_ERR, "Received unknown confirmation address type", __FILE__);
}
} catch (Exception $e) {
common_log(LOG_ERR, $e->getMessage());
return false;
}
return true;
}