aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/metastrings.php
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2012-01-25 11:48:59 -0800
committerBrett Profitt <brett.profitt@gmail.com>2012-01-25 11:48:59 -0800
commit6a2d3d7c2d22f57f28472d9d023788d20d41f005 (patch)
treeaaffc900f86b63cb2a74f6ecf3544d06d290a2f2 /engine/lib/metastrings.php
parente2af7b73d92a5eddeaed4bd129333045f6060c46 (diff)
downloadelgg-6a2d3d7c2d22f57f28472d9d023788d20d41f005.tar.gz
elgg-6a2d3d7c2d22f57f28472d9d023788d20d41f005.tar.bz2
Refs #4269. Using ElggBatch to delete annotations / metadata again.
Diffstat (limited to 'engine/lib/metastrings.php')
-rw-r--r--engine/lib/metastrings.php33
1 files changed, 3 insertions, 30 deletions
diff --git a/engine/lib/metastrings.php b/engine/lib/metastrings.php
index 62b60e279..d7cc4e0bc 100644
--- a/engine/lib/metastrings.php
+++ b/engine/lib/metastrings.php
@@ -727,38 +727,11 @@ function elgg_batch_metastring_based_objects(array $options, $callback) {
return false;
}
- switch($options['metastring_type']) {
- case 'metadata':
- $objects = elgg_get_metadata($options);
- break;
-
- case 'annotations':
- $objects = elgg_get_annotations($options);
- break;
-
- default:
- return false;
- }
-
- if (!is_array($objects)) {
- $r = false;
- } elseif (empty($objects)) {
- // ElggBatch returns null if the results are an empty array
- $r = null;
- } else {
- $r = true;
- foreach($objects as $object) {
- $r = $r && $callback($object);
- }
- }
+ // @todo restore once ElggBatch supports callbacks that delete rows.
+ $batch = new ElggBatch('elgg_get_metastring_based_objects', $options, $callback, 50, false);
+ $r = $batch->callbackResult;
return $r;
-
-// // @todo restore once ElggBatch supports callbacks that delete rows.
-// $batch = new ElggBatch('elgg_get_metastring_based_objects', $options, $callback);
-// $r = $batch->callbackResult;
-//
-// return $r;
}
/**