ZF-1328: Support Zend_Db_Select objects in quote(), quoteInto(), and quoteIdentifier()


I would like to be able to interpolate a Zend_Db_Select object into a query and have it be rendered as a string, and wrapped in parentheses so it can be a subquery:

$select = $db->select()
->from( $db->select()->from('subqueryTable') );

Should produce:

FROM (SELECT * FROM "subqueryTable")

$db->quoteInto('WHERE foo IN ?', $db->select()->from('subqueryTable'));

Should produce:

WHERE foo IN (SELECT * FROM "subqueryTable")

So we need that the quote() method and the quoteIdentifier() method check for an object of type Zend_Db_Select, and turn it into:

new Zend_Db_Expr( '(' . $selectObject->__toString() . ')' )

That should handle both cases.


Fixed in trunk - r8384