2012-06-14 17 views
7

मैं अपने कस्टम भंडार वर्ग में दूरी की गणना करना चाहता हूं।सिद्धांत क्वेरी बिल्डर एसीओएस फ़ंक्शन नहीं मिला

public function findLocation($latitude, $longitude) 
{ 
    $em = $this->getEntityManager(); 
    return $em->createQueryBuilder() 
        ->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') 
        ->from('StrictPlaceBundle:Poi', 'p') 
        ->add('orderBy', 's.distance ASC') 
        ->getQuery()->getResult();  
} 

क्या गलत हो सकता है:

[Syntax Error] line 0, col 70: Error: Expected known function, got 'ACOS' 

क्वेरी है: समस्या यह है कि सिद्धांत ACOS समारोह को संसाधित करते समय अपवाद फेंकता है?

उत्तर

संबंधित मुद्दे