From aedd4ee002b49fe6481814ea1003f749ea82f0f2 Mon Sep 17 00:00:00 2001 From: Marco Antonio Nina Date: Thu, 29 May 2014 09:38:31 -0400 Subject: [PATCH] BUG-14980 Validacion Date en Pmtables no es respetada SOLVED - The om propel class generates a validation for null values if for the fields date/time. - A validation was added in the om propel class for null values if in the pmtable it's defined. --- .../engine/builder/om/php5/PHP5BasicObjectBuilder.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gulliver/thirdparty/propel-generator/classes/propel/engine/builder/om/php5/PHP5BasicObjectBuilder.php b/gulliver/thirdparty/propel-generator/classes/propel/engine/builder/om/php5/PHP5BasicObjectBuilder.php index 7a656ac87..a448320c8 100755 --- a/gulliver/thirdparty/propel-generator/classes/propel/engine/builder/om/php5/PHP5BasicObjectBuilder.php +++ b/gulliver/thirdparty/propel-generator/classes/propel/engine/builder/om/php5/PHP5BasicObjectBuilder.php @@ -588,7 +588,15 @@ abstract class ".$this->getClassname()." extends ".ClassTools::classname($this-> $script .= " if (\$v !== null && !is_int(\$v)) { - \$ts = strtotime(\$v); + \$ts = strtotime(\$v);"; + if ($col->getPhpDefaultValue() != 1) { + $script .= " + //Date/time accepts null values + if (\$v == '') { + \$ts = null; + }"; + } + $script .=" if (\$ts === -1 || \$ts === false) { throw new PropelException(\"Unable to parse date/time value for [$clo] from input: \" . var_export(\$v, true));