PHP Class WC_Order_Refund

Author: WooThemes
Inheritance: extends WC_Abstract_Order
ファイルを表示 Open project: woocommerce/woocommerce Class Usage Examples

Protected Properties

Property Type Description
$data_store_name string Which data store to load.
$extra_data array Stores product data.

Public Methods

Method Description
__construct ( integer | object | WC_Order $read ) Extend the abstract _data properties and then read the order object.
__get ( string $key ) : mixed Magic __get method for backwards compatibility.
get_amount ( string $context = 'view' ) : integer | float Get refunded amount.
get_formatted_refund_amount ( ) : string Get formatted refunded amount.
get_post_title ( ) Get a title for the new post type.
get_reason ( string $context = 'view' ) : integer | float Get refund reason.
get_refund ( integer $id ) : boolean Gets an refund from the database.
get_refund_amount ( ) : integer | float Get refund amount.
get_refund_reason ( ) : integer | float Get refund reason.
get_refunded_by ( string $context = 'view' ) : integer Get ID of user who did the refund.
get_status ( string $context = 'view' ) : string Get status - always completed for refunds.
get_type ( ) : string Get internal type (post type.)
set_amount ( string $value ) Set refunded amount.
set_reason ( string $value ) Set refund reason.
set_refunded_by ( integer $value ) Set refunded by.

Protected Methods

Method Description
get_hook_prefix ( ) : string Prefix for action and filter hooks on data.

Method Details

__construct() public method

Extend the abstract _data properties and then read the order object.
public __construct ( integer | object | WC_Order $read )
$read integer | object | WC_Order Order to init.

__get() public method

Magic __get method for backwards compatibility.
public __get ( string $key ) : mixed
$key string
return mixed

get_amount() public method

Get refunded amount.
public get_amount ( string $context = 'view' ) : integer | float
$context string
return integer | float

get_formatted_refund_amount() public method

Get formatted refunded amount.
Since: 2.4

get_hook_prefix() protected method

Prefix for action and filter hooks on data.
Since: 2.7.0
protected get_hook_prefix ( ) : string
return string

get_post_title() public method

Get a title for the new post type.
public get_post_title ( )

get_reason() public method

Get refund reason.
Since: 2.2
public get_reason ( string $context = 'view' ) : integer | float
$context string
return integer | float

get_refund() public method

Gets an refund from the database.
Deprecation: 2.7
public get_refund ( integer $id ) : boolean
$id integer (default: 0).
return boolean

get_refund_amount() public method

Get refund amount.
Deprecation: 2.7
public get_refund_amount ( ) : integer | float
return integer | float

get_refund_reason() public method

Get refund reason.
Deprecation: 2.7
public get_refund_reason ( ) : integer | float
return integer | float

get_refunded_by() public method

Get ID of user who did the refund.
Since: 2.7
public get_refunded_by ( string $context = 'view' ) : integer
$context string
return integer

get_status() public method

Get status - always completed for refunds.
public get_status ( string $context = 'view' ) : string
$context string
return string

get_type() public method

Get internal type (post type.)
public get_type ( ) : string
return string

set_amount() public method

Set refunded amount.
public set_amount ( string $value )
$value string

set_reason() public method

Set refund reason.
public set_reason ( string $value )
$value string

set_refunded_by() public method

Set refunded by.
public set_refunded_by ( integer $value )
$value integer

Property Details

$data_store_name protected_oe property

Which data store to load.
protected string $data_store_name
return string

$extra_data protected_oe property

Stores product data.
protected array $extra_data
return array