MessageInfo
extends Message
in package
MessageInfo class.
Represents an info message object as defined in the Agentic Commerce Protocol.
Table of Contents
- $content : string
- Error content/message.
- $content_type : string
- Content type for the error message.
- $param : string|null
- RFC 9535 JSONPath to the problematic parameter (optional).
- $type : string
- The error type (always 'error' for message errors).
- __construct() : mixed
- Constructor.
- is_error() : bool
- Check if the message is an error.
- to_array() : array<string|int, mixed>
- Convert the error to an array.
- use_markdown() : mixed
- Use markdown content type for the content of the error.
Properties
$content
Error content/message.
protected
string
$content
$content_type
Content type for the error message.
protected
string
$content_type
= AutomatticWooCommerceInternalAgenticEnumsSpecsMessageContentType::PLAIN
Defaults to plain, but could also be markdown.
$param
RFC 9535 JSONPath to the problematic parameter (optional).
protected
string|null
$param
$type
The error type (always 'error' for message errors).
private
string
$type
= AutomatticWooCommerceInternalAgenticEnumsSpecsMessageType::INFO
Methods
__construct()
Constructor.
public
__construct(string $content[, string|null $param = null ]) : mixed
Parameters
- $content : string
-
Error content/message.
- $param : string|null = null
-
RFC 9535 JSONPath (optional).
Return values
mixed —is_error()
Check if the message is an error.
public
is_error() : bool
Return values
bool — True if the message is an error, false otherwise.to_array()
Convert the error to an array.
public
to_array() : array<string|int, mixed>
Return values
array<string|int, mixed> — A message for the `messages` array of the response.use_markdown()
Use markdown content type for the content of the error.
public
use_markdown() : mixed
