]> source.dussan.org Git - nextcloud-server.git/commit
feat(AppFramework): Add full support for date / time / datetime columns
authorFerdinand Thiessen <opensource@fthiessen.de>
Mon, 19 Aug 2024 14:43:17 +0000 (16:43 +0200)
committerFerdinand Thiessen <opensource@fthiessen.de>
Thu, 17 Oct 2024 16:31:42 +0000 (18:31 +0200)
commitee02e3246dc18a6390cd9fbfd7b66f441e71ccc1
tree3ebd0a84988aa677e6d8ffc6a057079a4140c6fc
parent40fd76f69e601ab5579e8ce9b81318d3924dd463
feat(AppFramework): Add full support for date / time / datetime columns

This adds support for all Doctrine supported types, for the column types only the immutable variants needed to be added.
But especially those types are the important ones, as our **Entity** class works by detecting changes through setters.
Meaning if it is mutable, changes like `$entity->date->modfiy()` can not be detected, so the immutable types make more sense here.

Similar the parameter types needed to be added.

`Enity` and `QBMapper` needed to be adjusted so they support (auto map) those types, required when insert or update an entity.

Also added more tests, especially to make sure the mapper really serializes the values correctly.

Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
14 files changed:
apps/federatedfilesharing/lib/FederatedShareProvider.php
apps/files_reminders/lib/Db/ReminderMapper.php
apps/sharebymail/lib/ShareByMailProvider.php
lib/private/Comments/Manager.php
lib/public/AppFramework/Db/Entity.php
lib/public/AppFramework/Db/QBMapper.php
lib/public/DB/QueryBuilder/IQueryBuilder.php
lib/public/DB/Types.php
lib/public/Migration/Attributes/ColumnType.php
tests/lib/AppFramework/Db/EntityTest.php
tests/lib/AppFramework/Db/QBMapperDBTest.php [new file with mode: 0644]
tests/lib/AppFramework/Db/QBMapperTest.php
tests/lib/Comments/ManagerTest.php
tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php