diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-04-05 00:15:00 +0300 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2022-04-13 15:06:29 +0300 |
commit | 781784553889601d02553931aed8ff1fde95640b (patch) | |
tree | 21dd1b23c192d23be1ab1f468ff77165b7591172 /lib/public | |
parent | cd95fce105fe5f0e71b1bcac7685464f936b9749 (diff) |
Add a metadata service to store file metadata
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/AppFramework/Db/Entity.php | 4 | ||||
-rw-r--r-- | lib/public/AppFramework/Db/QBMapper.php | 2 | ||||
-rw-r--r-- | lib/public/DB/QueryBuilder/IQueryBuilder.php | 5 | ||||
-rw-r--r-- | lib/public/DB/Types.php | 6 |
4 files changed, 17 insertions, 0 deletions
diff --git a/lib/public/AppFramework/Db/Entity.php b/lib/public/AppFramework/Db/Entity.php index 89e8f69859e..a059e3a27b0 100644 --- a/lib/public/AppFramework/Db/Entity.php +++ b/lib/public/AppFramework/Db/Entity.php @@ -120,6 +120,10 @@ abstract class Entity { if (!$args[0] instanceof \DateTime) { $args[0] = new \DateTime($args[0]); } + } elseif ($type === 'json') { + if (!is_array($args[0])) { + $args[0] = json_decode($args[0], true); + } } else { settype($args[0], $type); } diff --git a/lib/public/AppFramework/Db/QBMapper.php b/lib/public/AppFramework/Db/QBMapper.php index 5124650bc19..fa753a09dcf 100644 --- a/lib/public/AppFramework/Db/QBMapper.php +++ b/lib/public/AppFramework/Db/QBMapper.php @@ -253,6 +253,8 @@ abstract class QBMapper { return IQueryBuilder::PARAM_LOB; case 'datetime': return IQueryBuilder::PARAM_DATE; + case 'json': + return IQueryBuilder::PARAM_JSON; } return IQueryBuilder::PARAM_STR; diff --git a/lib/public/DB/QueryBuilder/IQueryBuilder.php b/lib/public/DB/QueryBuilder/IQueryBuilder.php index 76754f7bf41..afca9e372ee 100644 --- a/lib/public/DB/QueryBuilder/IQueryBuilder.php +++ b/lib/public/DB/QueryBuilder/IQueryBuilder.php @@ -65,6 +65,11 @@ interface IQueryBuilder { public const PARAM_DATE = 'datetime'; /** + * @since 24.0.0 + */ + public const PARAM_JSON = 'json'; + + /** * @since 9.0.0 */ public const PARAM_INT_ARRAY = Connection::PARAM_INT_ARRAY; diff --git a/lib/public/DB/Types.php b/lib/public/DB/Types.php index 4636ac3389f..31a474b03a0 100644 --- a/lib/public/DB/Types.php +++ b/lib/public/DB/Types.php @@ -110,4 +110,10 @@ final class Types { * @since 21.0.0 */ public const TIME = 'time'; + + /** + * @var string + * @since 24.0.0 + */ + public const JSON = 'json'; } |