aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-11 02:03:57 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-11 02:03:57 +0000
commita464f55feefd3252039a2fafc9cf95567e78cd95 (patch)
tree470a3981c5ea16d7f991f6de8947016a74167714 /engine/lib
parent0c65a46b3ff62fefb9efb1e4324291b8cb33e1c8 (diff)
downloadelgg-a464f55feefd3252039a2fafc9cf95567e78cd95.tar.gz
elgg-a464f55feefd3252039a2fafc9cf95567e78cd95.tar.bz2
Moved get_annotations() to deprecated-1.8.
git-svn-id: http://code.elgg.org/elgg/trunk@8110 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/annotations.php70
-rw-r--r--engine/lib/deprecated-1.8.php72
2 files changed, 72 insertions, 70 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php
index d0ff3559c..29e6f0a5c 100644
--- a/engine/lib/annotations.php
+++ b/engine/lib/annotations.php
@@ -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
diff --git a/engine/lib/deprecated-1.8.php b/engine/lib/deprecated-1.8.php
index 6a03ffb9d..5dee13118 100644
--- a/engine/lib/deprecated-1.8.php
+++ b/engine/lib/deprecated-1.8.php
@@ -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