WordPress\AiClient\Builders
MessageBuilder::__clone
Creates a deep clone of this builder.
Clones all MessagePart objects in the parts array to ensure the cloned builder is independent of the original.
Метод класса: MessageBuilder{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$MessageBuilder = new MessageBuilder(); $MessageBuilder->__clone();
Список изменений
| С версии 0.4.2 | Введена. |
Код MessageBuilder::__clone() MessageBuilder:: clone WP 7.1.4
public function __clone()
{
// Deep clone parts array (MessagePart has __clone)
$clonedParts = [];
foreach ($this->parts as $part) {
$clonedParts[] = clone $part;
}
$this->parts = $clonedParts;
// Note: $role is an enum value object and can be safely shared
}