add SelectHandle in Db service
This commit is contained in:
parent
5c8e3d8ccb
commit
2199a26b83
|
@ -0,0 +1,24 @@
|
||||||
|
<?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();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -32,6 +32,11 @@ class Db {
|
||||||
return new WestdcDb\Record\Record;
|
return new WestdcDb\Record\Record;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getSelectHandle()
|
||||||
|
{
|
||||||
|
return new WestdcDb\Record\Select;
|
||||||
|
}
|
||||||
|
|
||||||
public function getRecordDecorate($decorateName){
|
public function getRecordDecorate($decorateName){
|
||||||
$className = "RecordDecorate\\".$decorateName;
|
$className = "RecordDecorate\\".$decorateName;
|
||||||
return new $className;
|
return new $className;
|
||||||
|
|
Loading…
Reference in New Issue