WordPress\AiClient\Providers\Models\DTO
ModelConfig::__clone
Creates a deep clone of this configuration.
Clones nested objects (functionDeclarations, webSearch) to ensure the cloned configuration is independent of the original. Enum value objects (outputModalities, outputFileType, outputMediaOrientation) are intentionally shared as they are immutable.
Метод класса: ModelConfig{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$ModelConfig = new ModelConfig(); $ModelConfig->__clone();
Список изменений
| С версии 0.4.2 | Введена. |
Код ModelConfig::__clone() ModelConfig:: clone WP 7.1.4
public function __clone()
{
// Deep clone function declarations if set
if ($this->functionDeclarations !== null) {
$clonedDeclarations = [];
foreach ($this->functionDeclarations as $declaration) {
$clonedDeclarations[] = clone $declaration;
}
$this->functionDeclarations = $clonedDeclarations;
}
// Clone web search if set
if ($this->webSearch !== null) {
$this->webSearch = clone $this->webSearch;
}
// Note: Enum value objects (outputModalities, outputFileType, outputMediaOrientation)
// are immutable and can be safely shared.
}