diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-06-05 23:47:47 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-06-05 23:47:47 -0700 |
commit | 4e56176f35fe624d2d3a587636a4a45ea387be09 (patch) | |
tree | 8951394427b01adb7b21e733abd2495d606c0924 /modules/image_block/helpers | |
parent | 87fde3f360d557d48241d09cae4f25949e748d4f (diff) |
item::random_query() doesn't need to take a "where" clause because
it's returning a query, so the caller can add the where clause
himself. This makes for a cleaner API.
Diffstat (limited to 'modules/image_block/helpers')
-rw-r--r-- | modules/image_block/helpers/image_block_block.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/image_block/helpers/image_block_block.php b/modules/image_block/helpers/image_block_block.php index 51ccc4a0..da6e8782 100644 --- a/modules/image_block/helpers/image_block_block.php +++ b/modules/image_block/helpers/image_block_block.php @@ -31,7 +31,7 @@ class image_block_block_Core { // @todo Consider another fallback if further optimizations are necessary. $attempts = 0; do { - $item = item::random_query(array(array("type", "!=", "album")))->find_all(1)->current(); + $item = item::random_query()->where("type", "!=", "album")->find_all(1)->current(); } while (!$item && $attempts++ < 3); if ($item && $item->loaded()) { $block = new Block(); |