/**
  * 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;
 }
 /**
  * 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);
 }
Ejemplo n.º 3
0
 /**
  * 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;
 }