Permalink
Browse files

updates _updated_column and _created_column when creating

  • Loading branch information...
1 parent 21d9735 commit 15a7ea797397d3507a1a6766b9546c0539302869 @jimktrains committed Oct 29, 2010
Showing with 9 additions and 0 deletions.
  1. +9 −0 classes/kohana/orm.php
@@ -853,6 +853,15 @@ public function save()
$data[$column] = $this->_object[$column] = ($format === TRUE) ? time() : date($format);
}
+ if (is_array($this->_updated_column))
+ {
+ // Fill the updated column
+ $column = $this->_updated_column['column'];
+ $format = $this->_updated_column['format'];
+
+ $data[$column] = $this->_object[$column] = ($format === TRUE) ? time() : date($format);
+ }
+
$result = DB::insert($this->_table_name)
->columns(array_keys($data))
->values(array_values($data))

0 comments on commit 15a7ea7

Please sign in to comment.