1

カスタム選択で doctrine_rawsql を生成するのに問題があります。

これは私のrawsqlです

$distance = glength(linestringfromwkb(linestring(asbinary(GeomFromText('POINT( FLOAT('30') FLOAT('-3')),asbinary({l.point})))) as distance

$q->select($distance)
                ->from('place p INNER JOIN location l ON p.location_id = l.id')
                ->addComponent('p', 'Place p')
                ->addComponent('l', 'p.Location l')

私が行うと$q->getSql()、距離は生成されたSQLに表示されません。

何か案は?私は何か間違ったことをしていますか?

4

1 に答える 1

0

問題はDoctrine_Expressionを使用して解決されたようです

$user = new User(); 
$user->username = 'jwage'; 
$user->updated_at = new Doctrine_Expression('NOW()'); 
$user->save(); 
于 2011-05-22T18:37:00.300 に答える