Search code examples
sqlpropel

PROPEL - get the sql query


How can I get the sql query using this kind statement with propel?

$books = BookQuery::create()
  ->filterByTitle('War And Peace')
  ->find();

I need to log the query for debugging purpose

query ['SELECT book.* from `book` WHERE book.TITLE = War And Peace' ]

Solution

  • You can use the $books->toString() method.