Automattic\WooCommerce\Internal\DataStores\Orders

OrdersTableDataStore::is_post_different_from_order()privateWC 1.0

Computes whether post has been updated after last order. Tries to do it as efficiently as possible.

Method of the class: OrdersTableDataStore{}

No Hooks.

Return

true|false. True if post is different than order.

Usage

// private - for code of main (parent) class only
$result = $this->is_post_different_from_order( $order, $post_order ): bool;
$order(\WC_Abstract_Order) (required)
Order object.
$post_order(\WC_Abstract_Order) (required)
Order object read from posts table.

OrdersTableDataStore::is_post_different_from_order() code WC 9.3.3

private function is_post_different_from_order( $order, $post_order ): bool {
	if ( ArrayUtil::deep_compare_array_diff( $order->get_base_data(), $post_order->get_base_data(), false ) ) {
		return true;
	}

	$meta_diff = $this->get_diff_meta_data_between_orders( $order, $post_order );
	if ( ! empty( $meta_diff ) ) {
		return true;
	}

	return false;
}