- ⌂ cObject
- Methods
- Constructor
- add_variant()
- approve()
- as_array()
- can_add_variant()
- can_delete_variant()
- can_edit_variant()
- can_reorder_variant()
- clone()
- delete()
- edit_variant()
- enum()
- get_active_object()
- get_all_variants()
- get_attributes()
- get_dimensions()
- get_dimension_with()
- get_parent()
- get_primary_cpath()
- get_variant()
- Keywords()
- lock_object()
- reload_data()
- repo()
- revert()
- save()
- store()
- unlock_object()
- update_from_array()
- validate()
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();