diff options
Diffstat (limited to 'libs/Zend/Validate/Abstract.php')
-rw-r--r-- | libs/Zend/Validate/Abstract.php | 42 |
1 files changed, 11 insertions, 31 deletions
diff --git a/libs/Zend/Validate/Abstract.php b/libs/Zend/Validate/Abstract.php index cbecc5eebf..3107360619 100644 --- a/libs/Zend/Validate/Abstract.php +++ b/libs/Zend/Validate/Abstract.php @@ -14,20 +14,20 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Abstract.php 21726 2010-03-31 19:57:27Z rob $ + * @version $Id: Abstract.php 18688 2009-10-25 16:08:24Z thomas $ */ /** * @see Zend_Validate_Interface */ -// require_once 'Zend/Validate/Interface.php'; +require_once 'Zend/Validate/Interface.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Validate_Abstract implements Zend_Validate_Interface @@ -149,7 +149,7 @@ abstract class Zend_Validate_Abstract implements Zend_Validate_Interface } if (!isset($this->_messageTemplates[$messageKey])) { - // require_once 'Zend/Validate/Exception.php'; + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("No message template exists for key '$messageKey'"); } @@ -191,7 +191,7 @@ abstract class Zend_Validate_Abstract implements Zend_Validate_Interface /** * @see Zend_Validate_Exception */ - // require_once 'Zend/Validate/Exception.php'; + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("No property exists by the name '$property'"); } @@ -251,11 +251,11 @@ abstract class Zend_Validate_Abstract implements Zend_Validate_Interface } /** - * @param string $messageKey + * @param string $messageKey OPTIONAL * @param string $value OPTIONAL * @return void */ - protected function _error($messageKey, $value = null) + protected function _error($messageKey = null, $value = null) { if ($messageKey === null) { $keys = array_keys($this->_messageTemplates); @@ -328,7 +328,7 @@ abstract class Zend_Validate_Abstract implements Zend_Validate_Interface } elseif ($translator instanceof Zend_Translate) { $this->_translator = $translator->getAdapter(); } else { - // require_once 'Zend/Validate/Exception.php'; + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('Invalid translator specified'); } return $this; @@ -353,16 +353,6 @@ abstract class Zend_Validate_Abstract implements Zend_Validate_Interface } /** - * Does this validator have its own specific translator? - * - * @return bool - */ - public function hasTranslator() - { - return (bool)$this->_translator; - } - - /** * Set default translation object for all validate objects * * @param Zend_Translate|Zend_Translate_Adapter|null $translator @@ -375,7 +365,7 @@ abstract class Zend_Validate_Abstract implements Zend_Validate_Interface } elseif ($translator instanceof Zend_Translate) { self::$_defaultTranslator = $translator->getAdapter(); } else { - // require_once 'Zend/Validate/Exception.php'; + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('Invalid translator specified'); } } @@ -388,7 +378,7 @@ abstract class Zend_Validate_Abstract implements Zend_Validate_Interface public static function getDefaultTranslator() { if (null === self::$_defaultTranslator) { - // require_once 'Zend/Registry.php'; + require_once 'Zend/Registry.php'; if (Zend_Registry::isRegistered('Zend_Translate')) { $translator = Zend_Registry::get('Zend_Translate'); if ($translator instanceof Zend_Translate_Adapter) { @@ -403,16 +393,6 @@ abstract class Zend_Validate_Abstract implements Zend_Validate_Interface } /** - * Is there a default translation object set? - * - * @return boolean - */ - public static function hasDefaultTranslator() - { - return (bool)self::$_defaultTranslator; - } - - /** * Indicate whether or not translation should be disabled * * @param bool $flag |