Automattic\WooCommerce\Internal\RestApi\Routes\V4\Refunds\Schema

RefundSchema::get_line_items_responseprotectedWC 1.0

Standardize the line items response.

Метод класса: RefundSchema{}

Хуков нет.

Возвращает

Массив.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_line_items_response( $line_items, $request );
$line_items(массив) (обязательный)
Line items.
$request(WP_REST_Request) (обязательный)
Request object.

Код RefundSchema::get_line_items_response() WC 10.5.2

protected function get_line_items_response( $line_items, WP_REST_Request $request ) {
	$line_items_response = array();
	foreach ( $line_items as $line_item ) {
		$line_items_response[] = $this->prepare_line_item( $line_item, $request );
	}
	return $line_items_response;
}