ModelMetadata::toArray(): WordPressAiClientProvidersModelsDTOModelMetadataArrayShape

In this article

{@inheritDoc}

Return

WordPressAiClientProvidersModelsDTOModelMetadataArrayShape

Source

public function toArray(): array
{
    return [self::KEY_ID => $this->id, self::KEY_NAME => $this->name, self::KEY_SUPPORTED_CAPABILITIES => array_map(static fn(CapabilityEnum $capability): string => $capability->value, $this->supportedCapabilities), self::KEY_SUPPORTED_OPTIONS => array_map(static fn(\WordPress\AiClient\Providers\Models\DTO\SupportedOption $option): array => $option->toArray(), $this->supportedOptions)];
}

Changelog

VersionDescription
0.1.0Introduced.

User Contributed Notes

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