- ⌂ 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::get_active_object()
Returns the active/approved version of this object. If this is an object (aka it extends cObject instead of Content), the object itself will be returned because cObjects do not support versions. If it is the approved version, then it will return itself as well. If no active/approved version is available (only a working or draft versions exist), NULL will be returned.
Prototype
cObject get_active_object()
Return
Returns the active/approved version of this object. If this is an object (aka it extends cObject instead of Content), the object itself will be returned because cObjects do not support versions. If it is the approved version, then it will return itself as well. If no active/approved version is available (only a working or draft versions exist), NULL will be returned.
Example
$repo = \comand::repo();
$contact = $repo->get_first('FROM Contact');
// get all contacts this contact is an Emergency Contact for
$active = $contact->get_active_object();
echo("The approved version of this contact is $active.\n");