WordPress\AiClient\Providers\Models\DTO

ModelMetadata::__clonepublicWP 0.4.2

Performs a deep clone of the model metadata.

This method ensures that supported option objects are cloned to prevent modifications to the cloned metadata from affecting the original.

Method of the class: ModelMetadata{}

No Hooks.

Returns

null. Nothing (null).

Usage

$ModelMetadata = new ModelMetadata();
$ModelMetadata->__clone();

Changelog

Since 0.4.2 Introduced.

ModelMetadata::__clone() code WP 7.0

public function __clone()
{
    $clonedOptions = [];
    foreach ($this->supportedOptions as $option) {
        $clonedOptions[] = clone $option;
    }
    $this->supportedOptions = $clonedOptions;
}