webCOMAND

cObject::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.

Other dimensions of the object are not cloned.

Prototype

void clone()

Return

Returns a copy of the cObject.

Example

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