BeforeGenerateResultEvent::__clone()

In this article

Performs a deep clone of the event.

Description

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.

Source

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

Changelog

VersionDescription
0.4.2Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.