Commit 4e522ebf authored by jwage's avatar jwage

fixes #717

parent f9ee88a5
...@@ -95,6 +95,9 @@ class Doctrine_Template_Listener_Timestampable extends Doctrine_Record_Listener ...@@ -95,6 +95,9 @@ class Doctrine_Template_Listener_Timestampable extends Doctrine_Record_Listener
{ {
$options = $this->_options[$type]; $options = $this->_options[$type];
if ($options['expression'] !== false && is_string($options['expression'])) {
return new Doctrine_Expression($options['expression']);
} else {
if ($options['type'] == 'date') { if ($options['type'] == 'date') {
return date($options['format'], time()); return date($options['format'], time());
} else if ($options['type'] == 'timestamp') { } else if ($options['type'] == 'timestamp') {
...@@ -103,4 +106,5 @@ class Doctrine_Template_Listener_Timestampable extends Doctrine_Record_Listener ...@@ -103,4 +106,5 @@ class Doctrine_Template_Listener_Timestampable extends Doctrine_Record_Listener
return time(); return time();
} }
} }
}
} }
\ No newline at end of file
...@@ -43,11 +43,13 @@ class Doctrine_Template_Timestampable extends Doctrine_Template ...@@ -43,11 +43,13 @@ class Doctrine_Template_Timestampable extends Doctrine_Template
'type' => 'timestamp', 'type' => 'timestamp',
'format' => 'Y-m-d H:i:s', 'format' => 'Y-m-d H:i:s',
'disabled' => false, 'disabled' => false,
'expression' => false,
'options' => array()), 'options' => array()),
'updated' => array('name' => 'updated_at', 'updated' => array('name' => 'updated_at',
'type' => 'timestamp', 'type' => 'timestamp',
'format' => 'Y-m-d H:i:s', 'format' => 'Y-m-d H:i:s',
'disabled' => false, 'disabled' => false,
'expression' => false,
'options' => array())); 'options' => array()));
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment