Fix up the other delete signatures.

This commit is contained in:
Justin Shreve 2016-11-15 11:35:10 -08:00
parent eade55041c
commit 53524141b7
4 changed files with 5 additions and 13 deletions

View File

@ -117,7 +117,7 @@ abstract class WC_Data {
*/
public function delete( $force_delete = false ) {
if ( $this->data_store ) {
$this->data_store->delete( $this, $force_delete );
$this->data_store->delete( $this, array( 'force_delete' => $force_delete ) );
$this->set_id( 0 );
return true;
}

View File

@ -190,7 +190,7 @@ class WC_Customer extends WC_Legacy_Customer {
*/
public function delete_and_reassign( $reassign = null ) {
if ( $this->data_store ) {
$this->data_store->delete( $this, true, $reassign );
$this->data_store->delete( $this, array( 'force_delete' => true, 'reassign' => $reassign ) );
$this->set_id( 0 );
return true;
}

View File

@ -32,9 +32,9 @@ interface WC_Object_Data_Store {
/**
* Deletes a record from the database.
* @param WC_Data
* @param bool $force_delete True to permently delete, false to trash.
* @param WC_Data
* @param array $args Array of args to pass to the delete method.
* @return bool result
*/
public function delete( &$data, $force_delete = false );
public function delete( &$data, $args = array() );
}

View File

@ -14,14 +14,6 @@ if ( ! defined( 'ABSPATH' ) ) {
*/
interface WC_Customer_Data_Store_Interface {
/**
* Deletes a customer from the database.
*
* @param WC_Customer
* @param int|null $reassign Who to reassign posts to.
*/
public function delete( &$data, $reassign = null );
/**
* Gets the customers last order.
*