Automattic\WooCommerce\Internal\DataStores\Orders
OrdersTableDataStore::init_order_record()
Helper method to initialize order object from DB data.
Method of the class: OrdersTableDataStore{}
No Hooks.
Return
null
. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->init_order_record( $order, $order_id, $order_data );
- $order(\WC_Abstract_Order) (required)
- Order object.
- $order_id(int) (required)
- Order ID.
- $order_data(\stdClass) (required)
- Order data fetched from DB.
OrdersTableDataStore::init_order_record() OrdersTableDataStore::init order record code WC 9.3.3
protected function init_order_record( \WC_Abstract_Order &$order, int $order_id, \stdClass $order_data ) { $order->set_defaults(); $order->set_id( $order_id ); $filtered_meta_data = $this->filter_raw_meta_data( $order, $order_data->meta_data ); $order->init_meta_data( $filtered_meta_data ); $this->set_order_props_from_data( $order, $order_data ); $order->set_object_read( true ); }