From 7da8cf01d28ee40abe89cc65890cef373249551f Mon Sep 17 00:00:00 2001 From: Travis Bennett Date: Fri, 7 Oct 2016 19:34:11 +0000 Subject: [PATCH] Fix for #155 Use a plain DateTime object for the value of the {attachment}_updated_at field. --- src/Attachment.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Attachment.php b/src/Attachment.php index 1afff77..c2c29ab 100644 --- a/src/Attachment.php +++ b/src/Attachment.php @@ -9,6 +9,7 @@ use Codesleeve\Stapler\ORM\StaplerableInterface; use Codesleeve\Stapler\Factories\File as FileFactory; use JsonSerializable; +use DateTime; class Attachment implements AttachmentInterface, JsonSerializable { @@ -131,7 +132,7 @@ public function setUploadedFile($uploadedFile) $this->instanceWrite('file_name', $this->uploadedFile->getFilename()); $this->instanceWrite('file_size', $this->uploadedFile->getSize()); $this->instanceWrite('content_type', $this->uploadedFile->getMimeType()); - $this->instanceWrite('updated_at', date('Y-m-d H:i:s')); + $this->instanceWrite('updated_at', new DateTime); $this->queueAllForWrite(); }