Skip to content
This repository has been archived by the owner on Oct 16, 2019. It is now read-only.

Commit

Permalink
* Fixed Exception call
Browse files Browse the repository at this point in the history
* Swapped signature for setUnitTemplate(s) methods
  • Loading branch information
borisguery committed Feb 23, 2011
1 parent 59ab8ff commit b62cdd8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions library/Bgy/View/Helper/RelativeDateTime.php
Expand Up @@ -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;
Expand All @@ -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;
}
Expand All @@ -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];
Expand Down

0 comments on commit b62cdd8

Please sign in to comment.