GenerativeAiOperation::__clone()

In this article

Creates a deep clone of this operation.

Description

Clones the result object if present to ensure the cloned operation is independent of the original.
The state enum is immutable and can be safely shared.

Source

public function __clone()
{
    // Clone the result if present (GenerativeAiResult has __clone)
    if ($this->result !== null) {
        $this->result = clone $this->result;
    }
    // Note: $state is an immutable enum and can be safely shared
}

Changelog

VersionDescription
0.4.2Introduced.

User Contributed Notes

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