Skip to content

Instantly share code, notes, and snippets.

@matstani
Created March 9, 2014 09:41
Show Gist options
  • Save matstani/9445275 to your computer and use it in GitHub Desktop.
Save matstani/9445275 to your computer and use it in GitHub Desktop.
ZF2 TableGatewayを使わない検索
<?php
$sm = $this->getServiceLocator();
$adapter = $sm->get('Zend\Db\Adapter\Adapter');
$sql = new \Zend\Db\Sql\Sql($adapter);
$select = $sql->select();
$select->from('album');
//echo $select->getSqlString($adapter->getPlatform());
$statement = $sql->prepareStatementForSqlObject($select);
$resultSet = $statement->execute();
//SELECT `album`.* FROM `album`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment