Bug #103703
closedTYPO3 QueryBuilder does not allow all Doctrine DBAL types
0%
Description
TYPO3 decorates the doctrine dbal QueryBuilder. This includes the createNamedParameter() method.
Doctrine DBAL supports the following types in v12.4: int|string|Type|null
while TYPO3 only supports int
.TYPO3 main (13.x) supports ParameterType|ArrayParameterType
while newest dbal 4.x supports string|ParameterType|Type|ArrayParameterType
.
This leads to a situation that it seems impossible to provide a DateTimeImmutable
instance and allow dbal to properly cast it to date which could be provided as string in v12 or DateType
in main.
That comes in handy if using the native date/datetime/time fields introduced some time ago with TCA.
Is there a reason this is not supported by TYPO3?
Our example code with patched v12.4:
use TYPO3\CMS\Core\Database\Schema\Types\DateType;
$queryBuilder->where($queryBuilder->expr()->gte(
'date.start',
$queryBuilder->createNamedParameter($startAfter, new DateType())
));
Updated by Stefan Bürk 7 months ago
Good point. Will have a look on this week. TBH cannot tell
currently why. Will also check related ethods with type
paremeters and handling codes around.
Updated by Daniel Siepmann 7 months ago
- Status changed from New to Closed
- Priority changed from Should have to Won't have this time
We investigated once more and v13 already has this, so we don't need to backport to v12.