]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Moved get_annotations() to deprecated-1.8.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 11 Feb 2011 02:03:57 +0000 (02:03 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 11 Feb 2011 02:03:57 +0000 (02:03 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8110 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/annotations.php
engine/lib/deprecated-1.8.php

index d0ff3559cf04d891fb672f86411b930823972871..29e6f0a5cfc818fb4f6e963a5be422dc6003dd07 100644 (file)
@@ -482,76 +482,6 @@ function elgg_get_annotation_sql($table, $names = null, $values = null,
        return $return;
 }
 
-/**
- * Get a list of annotations for a given object/user/annotation type.
- *
- * @param int|array $entity_guid       GUID to return annotations of (falsey for any)
- * @param string    $entity_type       Type of entity
- * @param string    $entity_subtype    Subtype of entity
- * @param string    $name              Name of annotation
- * @param mixed     $value             Value of annotation
- * @param int|array $owner_guid        Owner(s) of annotation
- * @param int       $limit             Limit
- * @param int       $offset            Offset
- * @param string    $order_by          Order annotations by SQL
- * @param int       $timelower         Lower time limit
- * @param int       $timeupper         Upper time limit
- * @param int       $entity_owner_guid Owner guid for the entity
- *
- * @return array
- */
-function get_annotations($entity_guid = 0, $entity_type = "", $entity_subtype = "", $name = "",
-$value = "", $owner_guid = 0, $limit = 10, $offset = 0, $order_by = "asc", $timelower = 0,
-$timeupper = 0, $entity_owner_guid = 0) {
-       global $CONFIG;
-
-       $options = array();
-
-       if ($entity_guid) {
-               $options['guid'] = $entity_guid;
-       }
-
-       if ($entity_type) {
-               $options['type'] = $entity_type;
-       }
-
-       if ($entity_subtype) {
-               $options['subtype'] = $entity_subtype;
-       }
-
-       if ($name) {
-               $options['annotation_name'] = $name;
-       }
-
-       if ($value) {
-               $options['annotation_value'] = $value;
-       }
-
-       if ($owner_guid) {
-               $options['annotation_owner_guid'] = $owner_guid;
-       }
-
-       $options['limit'] = $limit;
-       $options['offset'] = $offset;
-
-       if ($order_by == 'desc') {
-               $options['order_by'] = 'a.time_created desc';
-       }
-
-       if ($timelower) {
-               $options['annotation_time_lower'] = $timelower;
-       }
-
-       if ($timeupper) {
-               $options['annotation_time_upper'] = $timeupper;
-       }
-
-       if ($entity_owner_guid) {
-               $options['owner_guid'] = $entity_owner_guid;
-       }
-
-       return elgg_get_annotations($options);
-}
 
 /**
  * Returns entities based upon annotations.  Accepts the same values as
index 6a03ffb9ddf87b6a6eb342f87e8a5279722e1164..5dee1311844537e12b864e20b730ef2902dfdf39 100644 (file)
@@ -3082,4 +3082,76 @@ function clear_plugin_setting($name, $plugin_id = "") {
 function clear_all_plugin_settings($plugin_id = "") {
        elgg_deprecated_notice('clear_all_plugin_settings() is deprecated by elgg_unset_all_plugin_setting()', 1.8);
        return elgg_unset_all_plugin_settings($plugin_id);
+}
+
+
+/**
+ * Get a list of annotations for a given object/user/annotation type.
+ *
+ * @param int|array $entity_guid       GUID to return annotations of (falsey for any)
+ * @param string    $entity_type       Type of entity
+ * @param string    $entity_subtype    Subtype of entity
+ * @param string    $name              Name of annotation
+ * @param mixed     $value             Value of annotation
+ * @param int|array $owner_guid        Owner(s) of annotation
+ * @param int       $limit             Limit
+ * @param int       $offset            Offset
+ * @param string    $order_by          Order annotations by SQL
+ * @param int       $timelower         Lower time limit
+ * @param int       $timeupper         Upper time limit
+ * @param int       $entity_owner_guid Owner guid for the entity
+ *
+ * @return array
+ */
+function get_annotations($entity_guid = 0, $entity_type = "", $entity_subtype = "", $name = "",
+$value = "", $owner_guid = 0, $limit = 10, $offset = 0, $order_by = "asc", $timelower = 0,
+$timeupper = 0, $entity_owner_guid = 0) {
+       global $CONFIG;
+
+       $options = array();
+
+       if ($entity_guid) {
+               $options['guid'] = $entity_guid;
+       }
+
+       if ($entity_type) {
+               $options['type'] = $entity_type;
+       }
+
+       if ($entity_subtype) {
+               $options['subtype'] = $entity_subtype;
+       }
+
+       if ($name) {
+               $options['annotation_name'] = $name;
+       }
+
+       if ($value) {
+               $options['annotation_value'] = $value;
+       }
+
+       if ($owner_guid) {
+               $options['annotation_owner_guid'] = $owner_guid;
+       }
+
+       $options['limit'] = $limit;
+       $options['offset'] = $offset;
+
+       if ($order_by == 'desc') {
+               $options['order_by'] = 'a.time_created desc';
+       }
+
+       if ($timelower) {
+               $options['annotation_time_lower'] = $timelower;
+       }
+
+       if ($timeupper) {
+               $options['annotation_time_upper'] = $timeupper;
+       }
+
+       if ($entity_owner_guid) {
+               $options['owner_guid'] = $entity_owner_guid;
+       }
+
+       return elgg_get_annotations($options);
 }
\ No newline at end of file