Symfony and Doctrine 1.2.2: How can i get the SQL clause of a Doctrine_Query object?

拥有回忆 提交于 2019-12-08 10:23:38

问题


i have this code:

  $this->lista_miembros = $this->filtro->buildQuery($valores_query);
  var_dump($this->lista_miembros);

var_dump outputs a Doctrine_Query object:

object(Doctrine_Query)[121]
protected '_subqueryAliases' => array

I tried getSql() ...

$q = Doctrine_Query::create()
    ->select('u.id')
    ->from('User u')
    ->whereIn('u.id', array(1, 3, 4, 5));
echo $q->getSql();

..but I dont have that getSql() function!

So how can i get the SQL clause of that Doctrine_Query object?

Javi


回答1:


echo $q->getSqlQuery();


来源:https://stackoverflow.com/questions/2772902/symfony-and-doctrine-1-2-2-how-can-i-get-the-sql-clause-of-a-doctrine-query-obj

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!