Skip to content

Commit 7da8cf0

Browse files
committed
Fix for #155 Use a plain DateTime object for the value of the {attachment}_updated_at field.
1 parent b93303a commit 7da8cf0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Attachment.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Codesleeve\Stapler\ORM\StaplerableInterface;
1010
use Codesleeve\Stapler\Factories\File as FileFactory;
1111
use JsonSerializable;
12+
use DateTime;
1213

1314
class Attachment implements AttachmentInterface, JsonSerializable
1415
{
@@ -131,7 +132,7 @@ public function setUploadedFile($uploadedFile)
131132
$this->instanceWrite('file_name', $this->uploadedFile->getFilename());
132133
$this->instanceWrite('file_size', $this->uploadedFile->getSize());
133134
$this->instanceWrite('content_type', $this->uploadedFile->getMimeType());
134-
$this->instanceWrite('updated_at', date('Y-m-d H:i:s'));
135+
$this->instanceWrite('updated_at', new DateTime);
135136
$this->queueAllForWrite();
136137
}
137138

0 commit comments

Comments
 (0)