Automattic\WooCommerce\StoreApi\Routes\V1\Agentic\Messages
MessageError::to_array
Convert the error to an array.
Method of the class: MessageError{}
No Hooks.
Returns
Array. A message for the messages array of the response.
Usage
$MessageError = new MessageError(); $MessageError->to_array(): array;
MessageError::to_array() MessageError::to array code WC 10.9.4
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;
}