WordPress\AiClient\Operations\DTO
GenerativeAiOperation::toArray
{@inheritDoc}
Method of the class: GenerativeAiOperation{}
No Hooks.
Returns
GenerativeAiOperationArrayShape.
Usage
$GenerativeAiOperation = new GenerativeAiOperation(); $GenerativeAiOperation->toArray(): array;
Changelog
| Since 0.1.0 | Introduced. |
GenerativeAiOperation::toArray() GenerativeAiOperation::toArray code WP 7.0
public function toArray(): array
{
$data = [self::KEY_ID => $this->id, self::KEY_STATE => $this->state->value];
if ($this->result !== null) {
$data[self::KEY_RESULT] = $this->result->toArray();
}
return $data;
}