WC_Abstract_Order::set_parent_id()publicWC 3.0.0

Set parent order ID.

Method of the class: WC_Abstract_Order{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Abstract_Order = new WC_Abstract_Order();
$WC_Abstract_Order->set_parent_id( $value );
$value(int) (required)
Value to set.

Changelog

Since 3.0.0 Introduced.

WC_Abstract_Order::set_parent_id() code WC 8.6.1

public function set_parent_id( $value ) {
	if ( $value && ( $value === $this->get_id() || ! wc_get_order( $value ) ) ) {
		$this->error( 'order_invalid_parent_id', __( 'Invalid parent ID', 'woocommerce' ) );
	}
	$this->set_prop( 'parent_id', absint( $value ) );
}