fixes #717
This commit is contained in:
parent
f9ee88a5c3
commit
4e522ebf6b
@ -95,6 +95,9 @@ class Doctrine_Template_Listener_Timestampable extends Doctrine_Record_Listener
|
||||
{
|
||||
$options = $this->_options[$type];
|
||||
|
||||
if ($options['expression'] !== false && is_string($options['expression'])) {
|
||||
return new Doctrine_Expression($options['expression']);
|
||||
} else {
|
||||
if ($options['type'] == 'date') {
|
||||
return date($options['format'], time());
|
||||
} else if ($options['type'] == 'timestamp') {
|
||||
@ -104,3 +107,4 @@ class Doctrine_Template_Listener_Timestampable extends Doctrine_Record_Listener
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -43,11 +43,13 @@ class Doctrine_Template_Timestampable extends Doctrine_Template
|
||||
'type' => 'timestamp',
|
||||
'format' => 'Y-m-d H:i:s',
|
||||
'disabled' => false,
|
||||
'expression' => false,
|
||||
'options' => array()),
|
||||
'updated' => array('name' => 'updated_at',
|
||||
'type' => 'timestamp',
|
||||
'format' => 'Y-m-d H:i:s',
|
||||
'disabled' => false,
|
||||
'expression' => false,
|
||||
'options' => array()));
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user