webCOMAND

Object::__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 COMAND Object constructor should not be called directly.  Instead, it is called internally by various API calls.  See Better Example below.

Prototype

Object Object(repository $repo, ContentType $content_type, integer $id = 0)

Parameters

Example

$repo = \comand::repo();
$ct = $repo->get_content_type('PublicationProcedure');
$pub_proc = new \comand\models\Object($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()