Skip to content

Commit

Permalink
updates _updated_column and _created_column when creating
Browse files Browse the repository at this point in the history
  • Loading branch information
jimktrains committed Oct 29, 2010
1 parent 21d9735 commit 15a7ea7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions classes/kohana/orm.php
Expand Up @@ -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))
Expand Down

0 comments on commit 15a7ea7

Please sign in to comment.