webCOMAND

cObject::repo()

Return the repository this object is associated with.  An object is associated with a repository when it is returned from a repository query, created as a new object with repo::new_object(), or similar.

Prototype

repository repo()

Return

Returns the repository this object is associated with.

Example

$repo = \comand::repo();
$contact = $repo->get('FROM Contact LIMIT 1');
$contact->FirstName = 'Jim';

sleep(60);

// reload field values that may have changed in the repository
// if FirstName has changed in the repository, it will not be
// reloaded because it was modified above.
$contact->reload_data();