Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/AppFramework/Db/Entity.php')
-rw-r--r--lib/public/AppFramework/Db/Entity.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/public/AppFramework/Db/Entity.php b/lib/public/AppFramework/Db/Entity.php
index 34719c82aea..374a1fd4d2c 100644
--- a/lib/public/AppFramework/Db/Entity.php
+++ b/lib/public/AppFramework/Db/Entity.php
@@ -115,7 +115,14 @@ abstract class Entity {
// (B)LOB is treated as string when we read from the DB
$type = 'string';
}
- settype($args[0], $type);
+
+ if ($type === 'datetime') {
+ if (!$args[0] instanceof \DateTime) {
+ $args[0] = new \DateTime($args[0]);
+ }
+ } else {
+ settype($args[0], $type);
+ }
}
$this->$name = $args[0];
} else {