WordPress\AiClient\Messages\DTO
Message::toArray
{@inheritDoc}
Method of the class: Message{}
No Hooks.
Returns
MessageArrayShape.
Usage
$Message = new Message(); $Message->toArray(): array;
Changelog
| Since 0.1.0 | Introduced. |
Message::toArray() Message::toArray code WP 7.0
public function toArray(): array
{
return [self::KEY_ROLE => $this->role->value, self::KEY_PARTS => array_map(function (\WordPress\AiClient\Messages\DTO\MessagePart $part) {
return $part->toArray();
}, $this->parts)];
}