diff options
author | dmitry-radyno <dmitry.radyno@gmail.com> | 2013-05-18 14:51:28 +0200 |
---|---|---|
committer | dmitry-radyno <dmitry.radyno@gmail.com> | 2013-05-18 14:51:28 +0200 |
commit | a195de87f3f78fee4da45e765fe5d0dac7b2455f (patch) | |
tree | 1c86f73b7c175788a10d92d1183f189f977bad1c /codebase/db_common.php | |
parent | f00479054b50298e9e5e048c086f8f9daf5ecdbf (diff) | |
download | connector-php-a195de87f3f78fee4da45e765fe5d0dac7b2455f.zip connector-php-a195de87f3f78fee4da45e765fe5d0dac7b2455f.tar.gz connector-php-a195de87f3f78fee4da45e765fe5d0dac7b2455f.tar.bz2 |
render_array and tree structure
Diffstat (limited to 'codebase/db_common.php')
-rw-r--r-- | codebase/db_common.php | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/codebase/db_common.php b/codebase/db_common.php index 8929631..19365f3 100644 --- a/codebase/db_common.php +++ b/codebase/db_common.php @@ -962,7 +962,25 @@ class ArrayDBDataWrapper extends DBDataWrapper{ return $res->data[$res->index++]; } public function select($sql){ - return new ArrayQueryWrapper($this->connection); + if ($this->config->relation_id["db_name"] == "") { + if ($sql->get_relation() == "0" || $sql->get_relation() == "") { + return new ArrayQueryWrapper($this->connection); + } else { + return new ArrayQueryWrapper(array()); + } + } + + $relation_id = $this->config->relation_id["db_name"]; + + for ($i = 0; $i < count($this->connection); $i++) { + $item = $this->connection[$i]; + if (!isset($item[$relation_id])) continue; + if ($item[$relation_id] == $sql->get_relation()) + $result[] = $item; + + } + + return new ArrayQueryWrapper($result); } public function query($sql){ throw new Exception("Not implemented"); |