WordPress\AiClient\Providers\Models\DTO

SupportedOption::toArraypublicWP 0.1.0

{@inheritDoc}

Method of the class: SupportedOption{}

No Hooks.

Returns

SupportedOptionArrayShape.

Usage

$SupportedOption = new SupportedOption();
$SupportedOption->toArray(): array;

Changelog

Since 0.1.0 Introduced.

SupportedOption::toArray() code WP 7.0

public function toArray(): array
{
    $data = [self::KEY_NAME => $this->name->value];
    if ($this->supportedValues !== null) {
        /** @var list<mixed> $supportedValues */
        $supportedValues = $this->supportedValues;
        $data[self::KEY_SUPPORTED_VALUES] = $supportedValues;
    }
    return $data;
}