Add DateTime support to database binding layer.

Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
This commit is contained in:
Taylor Otwell
2012-04-10 15:03:42 -05:00
parent 7d5b6b3748
commit 94b8582865
7 changed files with 32 additions and 15 deletions

View File

@@ -204,7 +204,7 @@ class Has_Many_And_Belongs_To extends Relationship {
{
if (Pivot::$timestamps)
{
$attributes['created_at'] = $this->model->get_timestamp();
$attributes['created_at'] = new \DateTime;
$attributes['updated_at'] = $attributes['created_at'];
}

View File

@@ -29,7 +29,7 @@ class Has_One_Or_Many extends Relationship {
{
if ($this->model->timestamps())
{
$attributes['updated_at'] = $this->model->get_timestamp();
$attributes['updated_at'] = new \DateTime;
}
return $this->table->update($attributes);