本文整理匯總了PHP中Subscription::getSubscribed方法的典型用法代碼示例。如果您正苦於以下問題:PHP Subscription::getSubscribed方法的具體用法?PHP Subscription::getSubscribed怎麽用?PHP Subscription::getSubscribed使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Subscription
的用法示例。
在下文中一共展示了Subscription::getSubscribed方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Subscription
function _deleteSubscriptions()
{
$sub = new Subscription();
$sub->subscriber = $this->getID();
$sub->find();
while ($sub->fetch()) {
try {
$other = $sub->getSubscribed();
if (!$other->sameAs($this)) {
Subscription::cancel($this, $other);
}
} catch (NoResultException $e) {
// Profile not found
common_log(LOG_INFO, 'Subscribed profile id==' . $sub->subscribed . ' not found when deleting profile id==' . $this->getID() . ', ignoring...');
} catch (ServerException $e) {
// Subscription cancel failed
common_log(LOG_INFO, 'Subscribed profile id==' . $other->getID() . ' could not be reached for unsubscription notice when deleting profile id==' . $this->getID() . ', ignoring...');
}
}
$sub = new Subscription();
$sub->subscribed = $this->getID();
$sub->find();
while ($sub->fetch()) {
try {
$other = $sub->getSubscriber();
common_log(LOG_INFO, 'Subscriber profile id==' . $sub->subscribed . ' not found when deleting profile id==' . $this->getID() . ', ignoring...');
if (!$other->sameAs($this)) {
Subscription::cancel($other, $this);
}
} catch (NoResultException $e) {
// Profile not found
common_log(LOG_INFO, 'Subscribed profile id==' . $sub->subscribed . ' not found when deleting profile id==' . $this->getID() . ', ignoring...');
} catch (ServerException $e) {
// Subscription cancel failed
common_log(LOG_INFO, 'Subscriber profile id==' . $other->getID() . ' could not be reached for unsubscription notice when deleting profile id==' . $this->getID() . ', ignoring...');
}
}
// Finally delete self-subscription
$self = new Subscription();
$self->subscriber = $this->getID();
$self->subscribed = $this->getID();
$self->delete();
}
示例2: initSubscriptionURI
function initSubscriptionURI()
{
printfnq("Ensuring all subscriptions have a URI...");
$sub = new Subscription();
$sub->whereAdd('uri IS NULL');
if ($sub->find()) {
while ($sub->fetch()) {
try {
$sub->decache();
$sub->query(sprintf('update subscription ' . 'set uri = "%s" ' . 'where subscriber = %d ' . 'and subscribed = %d', $sub->escape(Subscription::newUri($sub->getSubscriber(), $sub->getSubscribed(), $sub->created)), $sub->subscriber, $sub->subscribed));
} catch (Exception $e) {
common_log(LOG_ERR, "Error updated subscription URI: " . $e->getMessage());
}
}
}
printfnq("DONE.\n");
}