GenerativeAiOperation::toArray(): WordPressAiClientOperationsDTOGenerativeAiOperationArrayShape

In this article

{@inheritDoc}

Return

WordPressAiClientOperationsDTOGenerativeAiOperationArrayShape

Source

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;
}

Changelog

VersionDescription
0.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.