westdc-core/Westdc/Db/Record/Select.php

29 lines
581 B
PHP

<?php
/**
* Created by PhpStorm.
* User: liujin834
* Date: 3/8/15
* Time: 2:29 PM
*/
namespace Westdc\Db\Record;
use Zend\Db\Sql;
use Westdc\Db\Db;
class Select {
public function ResultSetToArray(Sql\Select $select){
$adapter = Db::getInstance();
$result = $adapter->query($select->getSqlString($adapter->getPlatform()),$adapter::QUERY_MODE_EXECUTE);
return $result->toArray();
}
public function GetSql(Sql\Select $select){
$adapter = Db::getInstance();
return $select->getSqlString($adapter->getPlatform());
}
}