Ticket #2570: PropelCrud.patch
| File PropelCrud.patch, 1.5 kB (added by Edir.Dumaszak, 1 year ago) |
|---|
-
/home/edir/Documentos/actions.class.php
old new 55 55 <?php foreach ($this->getTableMap()->getColumns() as $name => $column): $type = $column->getCreoleType(); ?> 56 56 <?php if ($name == 'CREATED_AT' || $name == 'UPDATED_AT') continue ?> 57 57 <?php $name = sfInflector::underscore($column->getPhpName()) ?> 58 <?php if ($type == CreoleTypes::DATE || $type == CreoleTypes::TIMESTAMP): ?>58 <?php if ($type == CreoleTypes::DATE): ?> 59 59 if ($this->getRequestParameter('<?php echo $name ?>')) 60 60 { 61 61 list($d, $m, $y) = sfI18N::getDateForCulture($this->getRequestParameter('<?php echo $name ?>'), $this->getUser()->getCulture()); 62 62 $<?php echo $this->getSingularName() ?>->set<?php echo $column->getPhpName() ?>("$y-$m-$d"); 63 63 } 64 <?php elseif ($type == CreoleTypes::TIMESTAMP): ?> 65 if ($this->getRequestParameter('<?php echo $name ?>')) 66 { 67 list($d, $m, $y, $h, $i) = sfI18N::getDateTimeForCulture($this->getRequestParameter('<?php echo $name ?>'), $this->getUser()->getCulture()); 68 $<?php echo $this->getSingularName() ?>->set<?php echo $column->getPhpName() ?>("$y-$m-$d $h:$i"); 69 } 64 70 <?php elseif ($type == CreoleTypes::BOOLEAN): ?> 65 71 $<?php echo $this->getSingularName() ?>->set<?php echo $column->getPhpName() ?>($this->getRequestParameter('<?php echo $name ?>', 0)); 66 72 <?php elseif ($column->isForeignKey()): ?>