diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-13 22:59:36 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-13 22:59:36 +0000 |
commit | 4be522d7544b1aca0e08828bee42a9be7345bf9c (patch) | |
tree | bb1c2ce1f7f177b2de7bb9615c4e87ea58516945 /engine/lib/elgglib.php | |
parent | c1c2563fc1cd451afaf735350eb1c576740be2f4 (diff) | |
download | elgg-4be522d7544b1aca0e08828bee42a9be7345bf9c.tar.gz elgg-4be522d7544b1aca0e08828bee42a9be7345bf9c.tar.bz2 |
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
Diffstat (limited to 'engine/lib/elgglib.php')
-rw-r--r-- | engine/lib/elgglib.php | 45 |
1 files changed, 44 insertions, 1 deletions
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); @@ -1683,6 +1684,48 @@ function elgg_sql_reverse_order_by_clause($order_by) { } /** + * 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. * * @link http://docs.elgg.org/Tutorials/WalledGarden |