summaryrefslogtreecommitdiff
path: root/modules/gallery
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-11-08 19:52:43 -0800
committerBharat Mediratta <bharat@menalto.com>2010-11-08 19:52:43 -0800
commitdae835449115b322c0ad057230a34a78d530b9a4 (patch)
treec99f543b6a991a088c6a6697cc4489009b87534b /modules/gallery
parent945e79b17182f7c96eb4b566bd41d26b5f8c4288 (diff)
Updated item::random_query() PHPdoc to include example usage
Diffstat (limited to 'modules/gallery')
-rw-r--r--modules/gallery/helpers/item.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/gallery/helpers/item.php b/modules/gallery/helpers/item.php
index 092904a5..052b1c8e 100644
--- a/modules/gallery/helpers/item.php
+++ b/modules/gallery/helpers/item.php
@@ -218,7 +218,13 @@ class item_Core {
}
/**
- * Return a query to get a random Item_Model, with optional filters
+ * Return a query to get a random Item_Model, with optional filters.
+ * Usage: item::random_query()->execute();
+ *
+ * Note: You can add your own ->where() clauses but if your Gallery is
+ * small or your where clauses are over-constrained you may wind up with
+ * no item. You should try running this a few times in a loop if you
+ * don't get an item back.
*/
static function random_query() {
// Pick a random number and find the item that's got nearest smaller number.