Automattic\WooCommerce\Internal\DataStores\Orders

OrdersTableDataStore::get_order_data_for_id()privateWC 1.0

Return order data for a single order ID.

Method of the class: OrdersTableDataStore{}

No Hooks.

Return

Object|\WP_Error. DB order object or WP_Error.

Usage

// private - for code of main (parent) class only
$result = $this->get_order_data_for_id( $id );
$id(int) (required)
Order ID.

OrdersTableDataStore::get_order_data_for_id() code WC 7.1.0

private function get_order_data_for_id( $id ) {
	$results = $this->get_order_data_for_ids( array( $id ) );

	return is_array( $results ) && count( $results ) > 0 ? $results[ $id ] : $results;
}