Use extra_data

This commit is contained in:
Mike Jolley 2016-11-21 14:20:29 +00:00
parent c06c357399
commit 1fdfd02766
1 changed files with 12 additions and 5 deletions

View File

@ -21,17 +21,24 @@ class WC_Order_Refund extends WC_Abstract_Order {
*/
protected $data_store_name = 'order-refund';
/**
* Stores product data.
*
* @var array
*/
protected $extra_data = array(
'amount' => '',
'reason' => '',
'refunded_by' => 0,
);
/**
* Extend the abstract _data properties and then read the order object.
*
* @param int|object|WC_Order $read Order to init.
*/
public function __construct( $read = 0 ) {
$this->data = array_merge( $this->data, array(
'amount' => '',
'reason' => '',
'refunded_by' => 0,
) );
$this->data = array_merge( $this->data, $this->extra_data );
parent::__construct( $read );
}