WordPress\AiClient\Events

BeforeGenerateResultEvent::__clone │ public │ WP 0.4.2

Performs a deep clone of the event.

This method ensures that message objects are cloned to prevent modifications to the cloned event from affecting the original. The model object is not cloned as it is a service object.

Метод класса: BeforeGenerateResultEvent{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

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

Список изменений

С версии 0.4.2 Введена.

Код BeforeGenerateResultEvent::__clone() WP 7.1.2

public function __clone()
{
    $clonedMessages = [];
    foreach ($this->messages as $message) {
        $clonedMessages[] = clone $message;
    }
    $this->messages = $clonedMessages;
}