From 2bc02a74887f35b3269903549d33f0e496a0477a Mon Sep 17 00:00:00 2001 From: Sam Georges Date: Fri, 30 May 2014 21:50:28 +1000 Subject: [PATCH] Fixes #191 --- modules/cms/classes/CmsObjectQuery.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/cms/classes/CmsObjectQuery.php b/modules/cms/classes/CmsObjectQuery.php index 69f0df865..616b8d62b 100644 --- a/modules/cms/classes/CmsObjectQuery.php +++ b/modules/cms/classes/CmsObjectQuery.php @@ -62,6 +62,19 @@ class CmsObjectQuery return $this; } + /** + * Finds a single Cms Object by its file name + * @param string $fileName + * @return CmsObject + */ + public function find($fileName) + { + if ($this->useCache) + return forward_static_call($this->cmsObject, 'loadCached', $this->theme, $fileName); + else + return forward_static_call($this->cmsObject, 'load', $this->theme, $fileName); + } + /** * Returns all CMS objects for the set theme * @return CmsObjectCollection