ModelMetadata::__clone()

In this article

Performs a deep clone of the model metadata.

Description

This method ensures that supported option objects are cloned to prevent modifications to the cloned metadata from affecting the original.

Source

public function __clone()
{
    $clonedOptions = [];
    foreach ($this->supportedOptions as $option) {
        $clonedOptions[] = clone $option;
    }
    $this->supportedOptions = $clonedOptions;
}

Changelog

VersionDescription
0.4.2Introduced.

User Contributed Notes

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