什么是Doctrine 2 DQL函数,相当于MySQL函数st_within
?
我确实需要此功能,因为我在运行此DQL查询时收到以下错误:
[Syntax Error] line 0, col 165: Error: Expected known function, got 'ST_Within'
我试图运行的DQL是:
public function getAdsInBounds($numberPerPage,$page){
$qb = $this->em->createQueryBuilder()
->select("m")
->from($this->getEntityClassName(), "m")
->where("ST_Within(point(m.lng, m.lat), envelope(linestring(point(10.090792984008772,36.83717099338201 ), point(10.310519546508772,36.749467295867646 )))")
->orderBy("m.date", "DESC");
return new Paginator($qb->getQuery()->setFirstResult(($page-1) * $numberPerPage)
->setMaxResults($numberPerPage));
}
FYI MySQL查询完美运行并返回预期结果。
谢谢,