Swat/SwatMoneyEntry.php
protected function getValidationMessage($id)
    {
        switch ($id) {
            case 'float':
                $locale = SwatI18NLocale::get($this->locale);
                $currency = $locale->getInternationalCurrencySymbol();
                $example = $locale->formatCurrency(1036.95, false, array(
                    'fractional_digits' => $this->decimal_places
                ));

                $text = sprintf(
                    $this->show_field_title_in_messages
                        ? Swat::_(
                            'The %%s field must be a monetary value ' .
                                'formatted for %s (i.e. %s).'
                        )
                        : Swat::_(
                            'This field must be a monetary value ' .
                                'formatted for %s (i.e. %s).'
                        ),
                    str_replace('%', '%%', $currency),
                    str_replace('%', '%%', $example)
                );

                $message = new SwatMessage($text, 'error');
                break;
            case 'currency-decimal-places':
                $text = $this->show_field_title_in_messages
                    ? Swat::_(
                        'The %%s field has too many decimal places. The ' .
                            'currency %s only allows %s.'
                    )
                    : Swat::_(
                        'This field has too many decimal places. The ' .
                            'currency %s only allows %s.'
                    );

                $message = new SwatMessage($text, 'error');
                break;
            case 'no-decimal-places':
                $text = $this->show_field_title_in_messages
                    ? Swat::_('The %s field must not have any decimal places.')
                    : Swat::_('This field must not have any decimal places.');

                $message = new SwatMessage($text, 'error');
                break;
            default:
                $message = parent::getValidationMessage($id);
                break;
        }

        return $message;
    }
protected function getValidationMessage($id)
    {
        switch ($id) {
            case 'float':
                $locale = SwatI18NLocale::get($this->locale);
                $currency = $locale->getInternationalCurrencySymbol();
                $example = $locale->formatCurrency(1036.95, false, array(
                    'fractional_digits' => $this->decimal_places
                ));

                $text = sprintf(
                    $this->show_field_title_in_messages
                        ? Swat::_(
                            'The %%s field must be a monetary value ' .
                                'formatted for %s (i.e. %s).'
                        )
                        : Swat::_(
                            'This field must be a monetary value ' .
                                'formatted for %s (i.e. %s).'
                        ),
                    str_replace('%', '%%', $currency),
                    str_replace('%', '%%', $example)
                );

                $message = new SwatMessage($text, 'error');
                break;
            case 'currency-decimal-places':
                $text = $this->show_field_title_in_messages
                    ? Swat::_(
                        'The %%s field has too many decimal places. The ' .
                            'currency %s only allows %s.'
                    )
                    : Swat::_(
                        'This field has too many decimal places. The ' .
                            'currency %s only allows %s.'
                    );

                $message = new SwatMessage($text, 'error');
                break;
            case 'no-decimal-places':
                $text = $this->show_field_title_in_messages
                    ? Swat::_('The %s field must not have any decimal places.')
                    : Swat::_('This field must not have any decimal places.');

                $message = new SwatMessage($text, 'error');
                break;
            default:
                $message = parent::getValidationMessage($id);
                break;
        }

        return $message;
    }
protected function getValidationMessage ( $ id ) { switch ( $ id ) { case 'float' : $ locale = SwatI18NLocale :: get ( $ this -> locale ) ; $ currency = $ locale -> getInternationalCurrencySymbol ( ) ; $ example = $ locale -> formatCurrency ( 1036.95 , false , array ( 'fractional_digits' => $ this -> decimal_places ) ) ; $ text = sprintf ( $ this -> show_field_title_in_messages ? Swat :: _ ( 'The %%s field must be a monetary value ' . 'formatted for %s (i.e. %s).' ) : Swat :: _ ( 'This field must be a monetary value ' . 'formatted for %s (i.e. %s).' ) , str_replace ( '%' , '%%' , $ currency ) , str_replace ( '%' , '%%' , $ example ) ) ; $ message = new SwatMessage ( $ text , 'error' ) ; break ; case 'currency-decimal-places' : $ text = $ this -> show_field_title_in_messages ? Swat :: _ ( 'The %%s field has too many decimal places. The ' . 'currency %s only allows %s.' ) : Swat :: _ ( 'This field has too many decimal places. The ' . 'currency %s only allows %s.' ) ; $ message = new SwatMessage ( $ text , 'error' ) ; break ; case 'no-decimal-places' : $ text = $ this -> show_field_title_in_messages ? Swat :: _ ( 'The %s field must not have any decimal places.' ) : Swat :: _ ( 'This field must not have any decimal places.' ) ; $ message = new SwatMessage ( $ text , 'error' ) ; break ; default : $ message = parent :: getValidationMessage ( $ id ) ; break ; } return $ message ; }
Gets a validation message for this money entry widget

@see SwatEntry::getValidationMessage()
@param string $id the string identifier of the validation message.

@return SwatMessage the validation message.
Gets a validation message for this money entry widget