- ⌂ 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::__construct()
Create a new object of a specific content type, associated with a repository. If no ID is specified, an ID of 0 will be used and the object will be assumed to be a new object that does not exist in the repository yet.
The cObject constructor should not be called directly. Instead, it is called internally by various API calls. See Better Example below.
Prototype
cObject cObject(repository $repo, ContentType $content_type, integer $id = 0)
Parameters
Example
$repo = \comand::repo();
$ct = $repo->get_content_type('PublicationProcedure');
$pub_proc = new \comand\models\cObject($repo, $ct);
$pub_proc->Identifier = 'Test';
$pub_proc->approve();
Better Example
$repo = \comand::repo();
$pub_proc = $repo->new_object('PublicationProcedure');
$pub_proc->Identifier = 'Test';
$pub_proc->approve()