API-A and API-M

Retrieval and modification of data/info stored on the fedora server is quite easy using tuque. For reading actions the API-A has been programmed, for writing the API-M. All actions are stored in methods that are bound to fedora object classes. Here are two examples for running a simple query (A) and changing the ownership of a file (M):

$tuque = islandora_get_tuque_connection();
#API-A
$api_a = $tuque->repository->api->a;
$condition = "ownerId=" . $GLOBALS['user']->name;
$results =  $api_a->findObjects('query',$condition);

#API-A
$api_m = $tuque->repository->api->m;
$pid = $result2['pid'];
$commit = $api_m->modifyObject($pid, array('ownerId' => 'admin', 'logMessage' => 'Daniels api-m test' ));