本文整理汇总了PHP中CB\Database\Table\UserTable::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP UserTable::delete方法的具体用法?PHP UserTable::delete怎么用?PHP UserTable::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CB\Database\Table\UserTable
的用法示例。
在下文中一共展示了UserTable::delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cbDeleteUser
/**
* Deletes a user without any check or warning, and related reports, sessions
*
* @deprecated 2.0 Use UserTable()->load( $condition or $id )->delete( null, $cbUserOnly )
*
* @param int $id User id
* @param string $condition ONLY allowed string: "return (\$user->block == 1);" (CBSubs 3.0.0) php condition string on $user e.g. "return (\$user->block == 1);"
* @param boolean $inComprofilerOnly deletes user only in CB, not in Mambo/Joomla
* @return null|boolean|string '' if user deleted and found ok, NULL if user not found, FALSE if condition was not met, STRING error in case of error raised by plugin
*/
function cbDeleteUser($id, $condition = null, $inComprofilerOnly = false)
{
if (!$id) {
return null;
}
$user = new UserTable();
if ($inComprofilerOnly) {
$user->load(array('user_id' => (int) $id));
} else {
$user->load((int) $id);
}
if (!$user->id) {
return null;
}
if ($condition == null || eval($condition)) {
if (!$user->delete((int) $id, $inComprofilerOnly)) {
return $user->getError();
}
return '';
}
return false;
}
示例2: updatePaymentStatus
//.........这里部分代码省略.........
} else {
// Free trials don't have a notification:
$thisIsReferencePayment = true;
}
if ($thisIsReferencePayment) {
// payment not yet processed:
$autorenewed = $paymentBasket->recurring == 1 && $unifiedStatus == 'Completed' && $previousUnifiedStatus == 'Completed';
for ($i = 0, $n = count($subscriptions); $i < $n; $i++) {
$reason = $autorenewed ? 'R' : $subscriptions[$i]->_reason;
$subscriptions[$i]->activate($user, $now, $completed, $reason, $occurrences, $autorecurring_type, $autorenew_type, $autorenewed ? 1 : 0);
}
}
break;
case 'RegistrationCancelled':
case 'Reversed':
case 'Refunded':
case 'Unsubscribed':
if ($unifiedStatus == 'RegistrationCancelled') {
if (!($previousUnifiedStatus == 'NotInitiated' || $previousUnifiedStatus === 'Pending' && $paymentBasket->payment_method === 'offline')) {
return;
}
}
for ($i = 0, $n = count($subscriptions); $i < $n; $i++) {
$reason = $subscriptions[$i]->_reason;
if ($reason != 'R' || in_array($unifiedStatus, array('Reversed', 'Refunded'))) {
// Expired and Cancelled as well as Partially-Refunded are not reverted ! //TBD: really revert on refund everything ? a plan param would be nice here
if (!in_array($previousUnifiedStatus, array('Pending', 'In-Progress', 'Denied', 'Reversed', 'Refunded')) && in_array($subscriptions[$i]->status, array('A', 'R', 'I')) && !$subscriptions[$i]->hasPendingPayment($paymentBasket->id)) {
// not a cancelled or denied renewal:
$subscriptions[$i]->revert($user, $unifiedStatus);
}
}
}
if ($unifiedStatus == 'RegistrationCancelled') {
$paymentBasket->historySetMessage('Payment basket deleted because the subscriptions and payment got cancelled');
$paymentBasket->delete();
// deletes also payment_Items
}
$paidUserExtension = cbpaidUserExtension::getInstance($paymentBasket->user_id);
$subscriptionsAnyAtAll = $paidUserExtension->getUserSubscriptions('');
$params = cbpaidApp::settingsParams();
$createAlsoFreeSubscriptions = $params->get('createAlsoFreeSubscriptions', 0);
if (count($subscriptionsAnyAtAll) == 0 && !$createAlsoFreeSubscriptions) {
$user = new UserTable();
$id = (int) cbGetParam($_GET, 'user');
$user->load((int) $id);
if ($user->id && $user->block == 1) {
$user->delete(null);
}
}
break;
case 'Denied':
case 'Pending':
if ($unifiedStatus == 'Denied') {
// In fact when denied, it's the case as if the user attempted payment but failed it: He should be able to re-try: So just store the payment as denied for the records.
if ($eventType == 'subscr_failed' || $eventType == 'subscr_cancel' && $autorecurring_type != 2) {
// special case of a failed attempt:
// or this is the final failed attempt of a basket with notifications:
break;
}
}
if ($previousUnifiedStatus == 'Completed') {
return;
// do not change a Completed payment as it cannot become Pending again. If we get "Pending" after "Completed", it is a messages chronological order mistake.
}
break;
case 'In-Progress':