webCOMAND

Object::clone()

Clone is used to create a new object with a copy of all field values, including references and embedded objects recursively.  The new cloned object, like any new object, will have no ID, OID or UUID until it is saved or approved to the repository.

Prototype

void clone()

Return

Returns a copy of the Object.

Example

$repo = \comand::repo();
$contact = $repo->get_first('FROM Contact LIMIT 1');
$duplicate = clone $contact;
$duplicate->approve();