diff options
author | Stanislau Wolski <stanislau.wolski@gmail.com> | 2012-12-26 15:27:05 +0300 |
---|---|---|
committer | Stanislau Wolski <stanislau.wolski@gmail.com> | 2012-12-26 15:27:05 +0300 |
commit | 2b095bc184f2db05f9895db11c270c95361296e7 (patch) | |
tree | a892115474889ecccdb5e3259268e9c8521b1802 /codebase | |
parent | 37e04ddc42dd488c04cabd324708f6307f7daa85 (diff) | |
download | connector-php-2b095bc184f2db05f9895db11c270c95361296e7.zip connector-php-2b095bc184f2db05f9895db11c270c95361296e7.tar.gz connector-php-2b095bc184f2db05f9895db11c270c95361296e7.tar.bz2 |
[update] yii based connector can get result set as initialiazation
parameter
Diffstat (limited to 'codebase')
-rw-r--r-- | codebase/db_phpyii.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/codebase/db_phpyii.php b/codebase/db_phpyii.php index 41066ee..f71d61a 100644 --- a/codebase/db_phpyii.php +++ b/codebase/db_phpyii.php @@ -8,12 +8,15 @@ require_once("db_common.php"); class PHPYiiDBDataWrapper extends ArrayDBDataWrapper{ public function select($sql){ - $res = $this->connection->findAll(); + if (is_array($this->connection)) //result of findAll + $res = $this->connection; + else + $res = $this->connection->findAll(); + if (sizeof($res)){ - $name = get_class($this->connection); $temp = array(); foreach ($res as $obj) - $temp[]=&$obj->getAttributes(); + $temp[]=$obj->getAttributes(); } return new ArrayQueryWrapper($temp); } |