Project

General

Profile

Bug #103703

Updated by Daniel Siepmann 18 days ago

TYPO3 decorates the doctrine dbal QueryBuilder. This includes the createNamedParameter() method. 
 Doctrine DBAL supports the following types in v12.4: <code>int|string|Type|null</code> while TYPO3 only supports <code>int</code>. 
 -TYPO3 TYPO3 main (13.x) supports <code>ParameterType|ArrayParameterType</code> while newest dbal 4.x supports <code>string|ParameterType|Type|ArrayParameterType</code>.- <code>string|ParameterType|Type|ArrayParameterType</code>. 

 This leads to a situation that it seems impossible to provide a <code>DateTimeImmutable</code> instance and allow dbal to properly cast it to date which could be provided as string in v12 or <code>DateType</code> 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: 

 <pre><code class="php"> 
 use TYPO3\CMS\Core\Database\Schema\Types\DateType; 

 $queryBuilder->where($queryBuilder->expr()->gte( 
     'date.start', 
     $queryBuilder->createNamedParameter($startAfter, new DateType()) 
 )); 
 </code></pre> 

Back