From 4be522d7544b1aca0e08828bee42a9be7345bf9c Mon Sep 17 00:00:00 2001 From: brettp Date: Sun, 13 Feb 2011 22:59:36 +0000 Subject: Refs #2907. DRY'd up and abstracted out a lot of metadata / annotation functions so I can implement #1115 with a clean conscious. git-svn-id: http://code.elgg.org/elgg/trunk@8207 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) (limited to 'engine/lib/elgglib.php') diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 7ebf918b7..a00b21c52 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -1664,8 +1664,9 @@ function css_page_handler($page) { * * This is used mostly for elgg_get_entities() and other similar functions. * - * @access private * @param string $order_by An order by clause + * @access private + * @return string */ function elgg_sql_reverse_order_by_clause($order_by) { $order_by = strtolower($order_by); @@ -1682,6 +1683,48 @@ function elgg_sql_reverse_order_by_clause($order_by) { return $return; } +/** + * Enable objects with an enable() method. + * + * Used as a callback for ElggBatch. + * + * @param object $object The object to enable + * @access private + * @return bool + */ +function elgg_batch_enable_callback($object) { + // our db functions return the number of rows affected... + return $object->enable() ? true : false; +} + +/** + * Disable objects with a disable() method. + * + * Used as a callback for ElggBatch. + * + * @param object $object The object to disable + * @access private + * @return bool + */ +function elgg_batch_disable_callback($object) { + // our db functions return the number of rows affected... + return $object->disable() ? true : false; +} + +/** + * Delete objects with a delete() method. + * + * Used as a callback for ElggBatch. + * + * @param object $object The object to disable + * @access private + * @return bool + */ +function elgg_batch_delete_callback($object) { + // our db functions return the number of rows affected... + return $object->delete() ? true : false; +} + /** * Intercepts the index page when Walled Garden mode is enabled. * -- cgit v1.2.3