WordPress\AiClient\Providers\Models\DTO
SupportedOption::toArray
{@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() 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;
}