Add DateTime support to database binding layer.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
This commit is contained in:
@@ -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'];
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user