Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
目的をテストするためにZend_Db_Tableのselect()ステートメントによって生成されたクエリを出力したいのですが、方法がわかりません。
実はとても簡単です。selectオブジェクトはtoStringメソッドを実装します。
$select = $table->select()->.... echo $select; //prints SQL
または
$sql = $select->__toString();
または、文字列にキャストしてから使用します。
(string)$table->select();