Automattic\WooCommerce\StoreApi\Routes\V1\Agentic\Messages

MessageError::to_arraypublicWC 1.0

Convert the error to an array.

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

Хуков нет.

Возвращает

Массив. A message for the messages array of the response.

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

$MessageError = new MessageError();
$MessageError->to_array(): array;

Код MessageError::to_array() WC 11.0.1

public function to_array(): array {
	$data = array(
		'type'         => $this->type,
		'code'         => $this->code,
		'content_type' => $this->content_type,
		'content'      => $this->content,
	);

	if ( null !== $this->param ) {
		$data['param'] = $this->param;
	}

	return $data;
}