Creates a deep clone of this metadata.
Description
Clones the provider metadata and all model metadata objects to ensure the cloned instance is independent of the original.
Source
public function __clone()
{
// Clone provider metadata
$this->provider = clone $this->provider;
// Deep clone models array (ModelMetadata has __clone)
$clonedModels = [];
foreach ($this->models as $model) {
$clonedModels[] = clone $model;
}
$this->models = $clonedModels;
}
Changelog
| Version | Description |
|---|---|
| 0.4.2 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.