[Solar-svn] Revision 3017
pmjones at solarphp.com
pmjones at solarphp.com
Tue Mar 18 08:30:03 CDT 2008
Solar_Sql_Model_Record: [CHG] When fields are invalid, now looks up INVALID_* locale keys for the column name as the feedback message. This lets you customize invalidation messages on a per-column basis."
Modified: trunk/Solar/Sql/Model/Record.php
===================================================================
--- trunk/Solar/Sql/Model/Record.php 2008-03-18 12:30:42 UTC (rev 3016)
+++ trunk/Solar/Sql/Model/Record.php 2008-03-18 13:30:03 UTC (rev 3017)
@@ -848,6 +848,16 @@
// was it valid?
if (! $valid) {
+
+ // use custom validation messages per column when available
+ foreach ($invalid as $key => $old) {
+ $locale_key = "INVALID_" . strtoupper($key);
+ $new = $this->_model->locale($locale_key);
+ if ($new != $locale_key) {
+ $invalid[$key] = $new;
+ }
+ }
+
$this->_status = 'invalid';
$this->_invalid = $invalid;
throw $this->_exception('ERR_INVALID', array($this->_invalid));
More information about the Solar-svn
mailing list