From 5dbe1e59d88f1fdbf301c70176b3ea3702ba0adf Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 11 May 2009 20:17:03 +0000 Subject: Add has_thumb() public API method --- core/models/item.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'core/models') diff --git a/core/models/item.php b/core/models/item.php index 5b9211be..3041e31e 100644 --- a/core/models/item.php +++ b/core/models/item.php @@ -204,6 +204,13 @@ class Item_Model extends ORM_MPTT { } } + /** + * Return true if there is a thumbnail for this item. + */ + public function has_thumb() { + return $this->thumb_width && $this->thumb_height; + } + /** * album: http://example.com/gallery3/var/resizes/album1/.thumb.jpg * photo: http://example.com/gallery3/var/albums/album1/photo.thumb.jpg -- cgit v1.2.3