WordPress\AiClient\Providers\DTO

ProviderMetadata::toArraypublicWP 0.1.0

{@inheritDoc}

Method of the class: ProviderMetadata{}

No Hooks.

Returns

ProviderMetadataArrayShape.

Usage

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

Changelog

Since 0.1.0 Introduced.
Since 1.2.0 Added description to output.
Since 1.3.0 Added logoPath to output.

ProviderMetadata::toArray() code WP 7.0

public function toArray(): array
{
    return [self::KEY_ID => $this->id, self::KEY_NAME => $this->name, self::KEY_DESCRIPTION => $this->description, self::KEY_TYPE => $this->type->value, self::KEY_CREDENTIALS_URL => $this->credentialsUrl, self::KEY_AUTHENTICATION_METHOD => $this->authenticationMethod ? $this->authenticationMethod->value : null, self::KEY_LOGO_PATH => $this->logoPath];
}