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

MessageInfo::to_arraypublicWC 1.0

Convert the error to an array.

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

Хуков нет.

Возвращает

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

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

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

Код MessageInfo::to_array() WC 11.0.1

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

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

	return $data;
}