title: Doctrine Query Builder ACOS function cannot be found
body: <p>I want to calculate distance in my custom repository class. The problem is that Doctrine throws exception while processing ACOS function:</p>
  
  <pre><code>[Syntax Error] line 0, col 70: Error: Expected known function, got 'ACOS'
  </code></pre>
  
  <p>Here is the query:</p>
  
  <pre><code>public function findLocation($latitude, $longitude)
  {
      $em = $this-&gt;getEntityManager();
      return $em-&gt;createQueryBuilder()
                      -&gt;select('((ACOS(SIN('.$latitude.' * PI() / 180) * SIN(p.latitude * PI() / 180) + COS('.$latitude.' * PI() / 180) * COS(p.latitude * PI() / 180) * COS(('.$longitude.' – p.longitude) * PI() / 180)) * 180 / PI()) * 60 * 1.1515) AS distance')
                      -&gt;from('StrictPlaceBundle:Poi', 'p')
                      -&gt;add('orderBy', 's.distance ASC')
                      -&gt;getQuery()-&gt;getResult();    
  }
  </code></pre>
  
  <p>What can be wrong?</p>