Browse Source

Fix acquiring of ownerId

Associated with ISLANDORA-757:  The findObjects call was broken.
pull/178/head
Adam Vessey 12 years ago
parent
commit
e363b937b4
  1. 18
      api/fedora_item.inc

18
api/fedora_item.inc

@ -79,7 +79,7 @@ class Fedora_Item {
if (!empty($raw_objprofile)) { if (!empty($raw_objprofile)) {
$this->objectProfile = $raw_objprofile->objectProfile; $this->objectProfile = $raw_objprofile->objectProfile;
$this->datastreams = $this->get_datastreams_list_as_array(); $this->datastreams = $this->get_datastreams_list_as_array();
$this->ownerId = & Fedora_Item::getOwnerId($pid); $this->ownerId = Fedora_Item::getOwnerId($pid);
} }
else { else {
$this->objectProfile = ''; $this->objectProfile = '';
@ -1165,7 +1165,6 @@ RDF;
* @return type * @return type
*/ */
function modify_object($label = '', $state = NULL, $ownerId = NULL, $logMessage = 'Modified by Islandora API', $quiet=TRUE) { function modify_object($label = '', $state = NULL, $ownerId = NULL, $logMessage = 'Modified by Islandora API', $quiet=TRUE) {
$params = array( $params = array(
'pid' => $this->pid, 'pid' => $this->pid,
// Default to the current owner if none is provided.. // Default to the current owner if none is provided..
@ -1551,9 +1550,17 @@ RDF;
* The Fedora PID to retrieve the * The Fedora PID to retrieve the
*/ */
static function getOwnerId($PID) { static function getOwnerId($PID) {
$params = array( $params = array(
'query' => array(array('property' => 'pid', 'operator' => 'eq', 'value' => $object_id)), 'query' => array(
'conditions' => array(
array(
'property' => 'pid',
'operator' => 'eq',
'value' => $PID,
),
),
'terms' => '',
),
'resultFields' => array('pid', 'ownerId'), 'resultFields' => array('pid', 'ownerId'),
'maxResults' => 1, 'maxResults' => 1,
); );
@ -1562,7 +1569,8 @@ RDF;
if (!$response) { if (!$response) {
return FALSE; return FALSE;
} }
return $response->result->resultList->objectFields->ownerId; $ownerId = $response->result->resultList->objectFields->ownerId;
return $ownerId;
} }
} }

Loading…
Cancel
Save