title: Using SQL functions with doctrine and TYPO3
body: <p>I am migrating an old TYPO3-extension to the current build and am trying to change my database access to using doctrine. For the most part that worked great, but now I came upon a few select queries, that make use of SQL-functions e.g. "Year(FROM_UNIXTIME())".</p>
  
  <p>I tried using the sql function as is in the following form:</p>
  
  <pre><code>$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)-&gt;getQueryBuilderForTable('mytable');
  
  $queryBuilder
       -&gt;select('i.*','c.title AS cat_title','c.uid AS cat_uid')
       -&gt;from('mytable','i')
      -&gt;join('c'
          ...
      )
      -&gt;join('d'
          ...
      )
      -&gt;where(
           $queryBuilder-&gt;expr()-&gt;eq('Year(FROM_UNIXTIME(i.datetime))', $queryBuilder-&gt;createNamedParameter($year, \PDO::PARAM_STR))
      )       
  
  </code></pre>
  
  <p>The problem is only with the where part, if i get a read-out on the SQL statement the where clause is simply omitted, as if the line of code never happened.</p>
  
  <p>I then proceeded to make debug statements around the where statement and encapsulate it in a try catch block with a log attached to it:
  It executes fine, without error, but does nothing.</p>
  
  <p>After google, I now believe, that i would need to implement that function again using the <a href="https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/cookbook/dql-user-defined-functions.html" rel="nofollow noreferrer">DQL user functions</a>, but the documentation on the typo3 site offers no mention of this and so i am a little unsure as to how to proceed.</p>
  
  <p>Can someone point me in the right direction? </p>
  
  <p>Any help would be much appreciated</p>
  
  <p>Regards 
  Theo</p>