From 6589c7c970fe4952f7d625b0f34009cc0f6ddf64 Mon Sep 17 00:00:00 2001 From: =Mark Roy Date: Tue, 21 Dec 2010 14:11:31 -0600 Subject: [PATCH] Added orderby option to get_related* functions. Defaults to as before. --- api/fedora_collection.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/fedora_collection.inc b/api/fedora_collection.inc index c0dce02a..3db41018 100644 --- a/api/fedora_collection.inc +++ b/api/fedora_collection.inc @@ -65,7 +65,7 @@ function export_collection($collection_pid, $relationship = 'isMemberOfCollectio * @param $query * @param $query_format R */ -function get_related_items_as_xml($collection_pid, $relationship = array('isMemberOfCollection'), $limit = 10000, $offset = 0, $active_objects_only = TRUE, $cmodel = NULL) { +function get_related_items_as_xml($collection_pid, $relationship = array('isMemberOfCollection'), $limit = 10000, $offset = 0, $active_objects_only = TRUE, $cmodel = NULL, $orderby = '$title') { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $collection_item = new Fedora_Item($collection_pid); @@ -104,7 +104,7 @@ function get_related_items_as_xml($collection_pid, $relationship = array('isMemb $query_string .= ') minus $content - order by $title'; + order by '.$orderby; $query_string = htmlentities(urlencode($query_string)); @@ -117,8 +117,8 @@ function get_related_items_as_xml($collection_pid, $relationship = array('isMemb return $content; } -function get_related_items_as_array($collection_pid, $relationship = 'isMemberOfCollection', $limit = 10000, $offset = 0, $active_objects_only = TRUE, $cmodel = NULL) { - $content = get_related_items_as_xml($collection_pid, $relationship, $limit, $offset, $active_objects_only, $cmodel); +function get_related_items_as_array($collection_pid, $relationship = 'isMemberOfCollection', $limit = 10000, $offset = 0, $active_objects_only = TRUE, $cmodel = NULL, $orderby = '$title') { + $content = get_related_items_as_xml($collection_pid, $relationship, $limit, $offset, $active_objects_only, $cmodel, $orderby); if (empty($content)) { return array(); }