WordPress\AiClient\Messages\DTO
MessagePart::__clone
Performs a deep clone of the message part.
This method ensures that nested objects (file, function call, function response) are cloned to prevent modifications to the cloned part from affecting the original.
Method of the class: MessagePart{}
No Hooks.
Returns
null. Nothing (null).
Usage
$MessagePart = new MessagePart(); $MessagePart->__clone();
Changelog
| Since 0.4.2 | Introduced. |
MessagePart::__clone() MessagePart:: clone code WP 7.0
public function __clone()
{
if ($this->file !== null) {
$this->file = clone $this->file;
}
if ($this->functionCall !== null) {
$this->functionCall = clone $this->functionCall;
}
if ($this->functionResponse !== null) {
$this->functionResponse = clone $this->functionResponse;
}
}