本文整理匯總了PHP中Subscriber::update方法的典型用法代碼示例。如果您正苦於以下問題:PHP Subscriber::update方法的具體用法?PHP Subscriber::update怎麽用?PHP Subscriber::update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Subscriber
的用法示例。
在下文中一共展示了Subscriber::update方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: processBounceData
/**
* Porcess the bounce data and update the database
* @param Bounce $bounce
* @param int $campaign_id
* @param Subscriber $subscriber
* @return bool
*/
private function processBounceData($bounce, $campaign_id, $subscriber)
{
if ($campaign_id === 'systemmessage' && $subscriber !== false) {
$bounce->status = 'bounced system message';
$bounce->comment = sprintf('%s marked unconfirmed', $subscriber->id);
$bounce->update();
phpList::log()->notice($subscriber->id . ' ' . s('system message bounced, subscriber marked unconfirmed'));
$subscriber->addHistory(s('Bounced system message'), sprintf('<br/>%s<br/><a href="./?page=bounce&id=%d">%s</a>', s('Subscriber marked unconfirmed'), $bounce->id, s('View Bounce')), $subscriber->id);
$subscriber->confirmed = 0;
$subscriber->update();
} elseif (!empty($campaign_id) && $subscriber !== false) {
$bounce->connectMeToSubscriberAndMessage($subscriber, $campaign_id);
} elseif ($subscriber !== false) {
$bounce->status = 'bounced unidentified message';
$bounce->comment = $subscriber->id . ' bouncecount increased';
$bounce->update();
$subscriber->bouncecount++;
$subscriber->update();
} elseif ($campaign_id === 'systemmessage') {
$bounce->status = 'bounced system message';
$bounce->comment = 'unknown subscriber';
$bounce->update();
phpList::log()->notice($subscriber->id . ' ' . s('system message bounced, but unknown subscriber'));
} elseif ($campaign_id) {
$bounce->status = sprintf('bounced list message %d', $campaign_id);
$bounce->comment = 'unknown subscriber';
$bounce->update();
phpList::DB()->query(sprintf('UPDATE %s
SET bouncecount = bouncecount + 1
WHERE id = %d', Config::getTableName('message'), $campaign_id));
} else {
$bounce->status = 'unidentified bounce';
$bounce->comment = 'not processed';
$bounce->update();
return false;
}
return true;
}
示例2: connectMeToSubscriberAndMessage
/**
* Add this bounce to a user and message
* @param Subscriber $subscriber
* @param int $campaign_id
*/
public function connectMeToSubscriberAndMessage($subscriber, $campaign_id)
{
## check if we already have this um as a bounce
## so that we don't double count "delayed" like bounces
$exists = phpList::DB()->query(sprintf('SELECT COUNT(*) FROM %s
WHERE user = %d
AND message = %d', Config::getTableName('user_message_bounce'), $subscriber->id, $campaign_id));
phpList::DB()->query(sprintf('INSERT INTO %s
SET user = %d, message = %d, bounce = %d', Config::getTableName('user_message_bounce'), $subscriber->id, $campaign_id, $this->id));
$this->status = 'bounced list message ' . $campaign_id;
$this->comment = $subscriber->id . 'bouncecount increased';
$this->save();
## if the relation did not exist yet, increment the counters
if ($exists->rowCount() > 0) {
phpList::DB()->query(sprintf('UPDATE %s
SET bouncecount = bouncecount + 1
WHERE id = %d', Config::getTableName('message'), $campaign_id));
$subscriber->bouncecount++;
$subscriber->update();
}
}