Example #1
0
 /**
  * Sets the validation failure message template for a particular key
  * Adds the ability to set messages to the attached hostname validator
  *
  * @param  string $messageString
  * @param  string $messageKey     OPTIONAL
  * @return Postman_Zend_Validate_Abstract Provides a fluent interface
  * @throws Postman_Zend_Validate_Exception
  */
 public function setMessage($messageString, $messageKey = null)
 {
     if ($messageKey === null) {
         $this->_options['hostname']->setMessage($messageString);
         parent::setMessage($messageString);
         return $this;
     }
     if (!isset($this->_messageTemplates[$messageKey])) {
         $this->_options['hostname']->setMessage($messageString, $messageKey);
     }
     $this->_messageTemplates[$messageKey] = $messageString;
     return $this;
 }