Last active
August 29, 2015 14:01
-
-
Save samsonasik/514cb5333e7ed12875fe to your computer and use it in GitHub Desktop.
abstract sql object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Zend\Db\Sql\Sql; | |
$sql = new Sql($adapter); | |
$oSelect = $sql->select('table_test'); | |
$oSelect->columns(array('*'))->where(array('test' => 'ok')->limit(1); | |
$sqlString = $sql->getSqlStringForSqlObject($oSelect); | |
//see https://github.com/zendframework/zf2/issues/3224 | |
in Model Table class : | |
$sql = $this->tableGateway->getSql(); | |
$select = $sql->select(); | |
$select->where(array('column_name' => 'some value')); | |
$sql->getSqlstringForSqlObject($select); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment