From b62cdd80a3d511c70c557cf5b2da9a696dc2502b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boris=20Gu=8Ery?= Date: Wed, 23 Feb 2011 10:28:00 +0100 Subject: [PATCH] * Fixed Exception call * Swapped signature for setUnitTemplate(s) methods --- library/Bgy/View/Helper/RelativeDateTime.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/library/Bgy/View/Helper/RelativeDateTime.php b/library/Bgy/View/Helper/RelativeDateTime.php index 451ae9f..5adfe4d 100644 --- a/library/Bgy/View/Helper/RelativeDateTime.php +++ b/library/Bgy/View/Helper/RelativeDateTime.php @@ -79,11 +79,11 @@ public function relativeDateTime(Zend_Date $date = null) return $formatedString; } - public function setUnitTemplate($template, $unitKey) + public function setUnitTemplate($unitKey, $template) { if (!isset($this->_unitTemplates[$unitKey])) { - require_once 'Bgy/Helper/Exception.php'; - throw new Zend_Validate_Exception("No unit template exists for key '$unitKey'"); + require_once 'Bgy/View/Helper/Exception.php'; + throw new Bgy_View_Helper_Exception("No unit template exists for key '$unitKey'"); } $this->_unitTemplates[$unitKey] = $template; @@ -94,7 +94,7 @@ public function setUnitTemplate($template, $unitKey) public function setUnitTemplates(array $templates) { foreach ($templates as $key => $template) { - $this->setUnitTemplate($template, $key); + $this->setUnitTemplate($key, $template); } return $this; } @@ -107,8 +107,8 @@ public function getUnitTemplates() public function getUnitTemplate($unitKey) { if (!isset($this->_unitTemplates[$unitKey])) { - require_once 'Bgy/Helper/Exception.php'; - throw new Bgy_Helper_Exception("No unit template exists for key '$unitKey'"); + require_once 'Bgy/View/Helper/Exception.php'; + throw new Bgy_View_Helper_Exception("No unit template exists for key '$unitKey'"); } return $this->_unitTemplates[$unitKey];