本文整理汇总了PHP中EEM_Base::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP EEM_Base::delete方法的具体用法?PHP EEM_Base::delete怎么用?PHP EEM_Base::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EEM_Base
的用法示例。
在下文中一共展示了EEM_Base::delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
/**
* Overrides parent so that after running this, we also double-check
* the term taxonomy counts are up-to-date
* @param array $query_params @see EEM_Base::get_all
* @param boolean $allow_blocking
* @return int @see EEM_Base::delete
*/
public function delete($query_params, $allow_blocking = true)
{
$count = parent::delete($query_params, $allow_blocking);
if ($count) {
$this->update_term_taxonomy_counts();
}
return $count;
}
示例2: delete_permanently
/**
* Permanently deletes the selected rows. When selecting rows for deletion, ignores
* whether they've been soft-deleted or not. (ie, you don't have to soft-delete objects
* before you can permanently delete them).
* Because this will cause a real deletion, related models may block this deletion (ie, add an error
* and abort the delete)
* @param array $query_params like EEM_Base::get_all
* @param boolean $allow_blocking if TRUE, matched objects will only be deleted if there is no related model info
* that blocks it (ie, there' sno other data that depends on this data); if false, deletes regardless of other objects
* which may depend on it. Its generally advisable to always leave this as TRUE, otherwise you could easily corrupt your DB
* @return boolean success
*/
public function delete_permanently($query_params = array(), $allow_blocking = true)
{
$query_params = $this->_alter_query_params_so_deleted_and_undeleted_items_included($query_params);
return parent::delete($query_params, $allow_blocking);
}
示例3: delete_by_ID
/**
* Deleted the payment indicated by the payment object or id, and returns
* the EE_transaction which gets affected and updated in the process
* @param EE_Payment or id $payment_obj_or_id
* @return EE_Transaction
*/
public function delete_by_ID($payment_obj_or_id)
{
$payment_before_deleted = $this->ensure_is_obj($payment_obj_or_id);
$query_params = array();
$query_params[0] = array($this->get_primary_key_field()->get_name() => $payment_obj_or_id);
$query_params['limit'] = 1;
parent::delete($query_params);
$transaction = $payment_before_deleted->transaction();
$transaction->update_based_on_payments();
return $transaction;
}