aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/relationships.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-02-17 23:14:33 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-02-17 23:14:33 +0000
commitba94a48ff66a001dd20c5ac2da34681880583945 (patch)
tree29b0ebfcd19ba03c69cd8ad7e4171c0002b3d207 /engine/lib/relationships.php
parentb3012350e2d8dafaf696e2c472f8cf0ae5e1674b (diff)
downloadelgg-ba94a48ff66a001dd20c5ac2da34681880583945.tar.gz
elgg-ba94a48ff66a001dd20c5ac2da34681880583945.tar.bz2
Fixes #1488: Removed use of deprecated functions in core.
git-svn-id: http://code.elgg.org/elgg/trunk@3947 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/relationships.php')
-rw-r--r--engine/lib/relationships.php21
1 files changed, 17 insertions, 4 deletions
diff --git a/engine/lib/relationships.php b/engine/lib/relationships.php
index 789dd4575..c67596837 100644
--- a/engine/lib/relationships.php
+++ b/engine/lib/relationships.php
@@ -662,11 +662,24 @@ $count = false, $site_guid = 0) {
* @param true|false $pagination Whether to display pagination (default: true)
* @return string The viewable list of entities
*/
-function list_entities_from_relationship($relationship, $relationship_guid, $inverse_relationship = false, $type = "", $subtype = "", $owner_guid = 0, $limit = 10, $fullview = true, $viewtypetoggle = false, $pagination = true) {
+function list_entities_from_relationship($relationship, $relationship_guid, $inverse_relationship = false, $type = ELGG_ENTITIES_ANY_VALUE, $subtype = ELGG_ENTITIES_ANY_VALUE, $owner_guid = 0, $limit = 10, $fullview = true, $viewtypetoggle = false, $pagination = true) {
$limit = (int) $limit;
$offset = (int) get_input('offset');
- $count = get_entities_from_relationship($relationship, $relationship_guid, $inverse_relationship, $type, $subtype, $owner_guid, "", $limit, $offset, true);
- $entities = get_entities_from_relationship($relationship, $relationship_guid, $inverse_relationship, $type, $subtype, $owner_guid, "", $limit, $offset);
+ $options = array(
+ 'relationship' => $relationship,
+ 'relationship_guid' => $relationship_guid,
+ 'inverse_relationship' => $inverse_relationship,
+ 'types' => $type,
+ 'subtypes' => $subtype,
+ 'owner_guid' => $owner_guid,
+ 'order_by' => '',
+ 'limit' => $limit,
+ 'offset' => $offset,
+ 'count' => TRUE
+ );
+ $count = elgg_get_entities_from_relationship($options);
+ $options['count'] = FALSE;
+ $entities = elgg_get_entities_from_relationship($options);
return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $viewtypetoggle, $pagination);
}
@@ -947,7 +960,7 @@ function already_attached($guid_one, $guid_two){
**/
function get_attachments($guid, $type=""){
- $attached = get_entities_from_relationship("attached", $guid, $inverse_relationship = false, $type, $subtype = "", $owner_guid = 0, $order_by = "time_created desc", $limit = 10, $offset = 0, $count = false, $site_guid = 0);
+ $attached = elgg_get_entities_from_relationship(array('relationship' => 'attached', 'relationship_guid' => $guid, 'inverse_relationship' => $inverse_relationship = false, 'types' => $type, 'subtypes' => '', 'owner_guid' => 0, 'order_by' => 'time_created desc', 'limit' => 10, 'offset' => 0, 'count' => false, 'site_guid' => 0));
return $attached;
}