protected function error( $messageKey, $value = null ) {
        //was a global message set? let's use the global key then
        if( key_exists( self::GLOBAL_MESSAGE_KEY, $this->templates ) )
            $messageKey = self::GLOBAL_MESSAGE_KEY;
        
        //invalide message key
        if( !key_exists( $messageKey, $this->templates ) )
            throw new Exception\MessageTemplateDoesNotExist( "A message template does not exist for key $messageKey" );

        $this->messages[ $messageKey ] = $this->buildMessage( $this->templates[$messageKey], $value );
    }
protected function error( $messageKey, $value = null ) {
        //was a global message set? let's use the global key then
        if( key_exists( self::GLOBAL_MESSAGE_KEY, $this->templates ) )
            $messageKey = self::GLOBAL_MESSAGE_KEY;
        
        //invalide message key
        if( !key_exists( $messageKey, $this->templates ) )
            throw new Exception\MessageTemplateDoesNotExist( "A message template does not exist for key $messageKey" );

        $this->messages[ $messageKey ] = $this->buildMessage( $this->templates[$messageKey], $value );
    }
protected function error ( $ messageKey , $ value = null ) { //was a global message set? let's use the global key then
 if ( key_exists ( self :: GLOBAL_MESSAGE_KEY , $ this -> templates ) ) $ messageKey = self :: GLOBAL_MESSAGE_KEY ; //invalide message key
 if ( ! key_exists ( $ messageKey , $ this -> templates ) ) throw new Exception \ MessageTemplateDoesNotExist ( "A message template does not exist for key $messageKey" ) ; $ this -> messages [ $ messageKey ] = $ this -> buildMessage ( $ this -> templates [ $ messageKey ] , $ value ) ; }
Adds an error message to the list of errors.
@param $messageKey The key of the message template.
@param $value The value that is being validated.
@throws Exception\MessageTemplateDoesNotExist The message template does not exist.
Adds an error message to the list of errors .