Message
in package
Base class for error and info messages.
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).
- is_error() : bool
- Check if the message is an error.
- to_array() : array<string|int, mixed>
- Convert the message 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
Methods
is_error()
Check if the message is an error.
public
abstract is_error() : bool
Return values
bool — True if the message is an error, false otherwise.to_array()
Convert the message to an array.
public
abstract 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
