summaryrefslogtreecommitdiffstats
path: root/codebase/db_common.php
diff options
context:
space:
mode:
authorStanislau Wolski <stanislau.wolski@gmail.com>2013-05-30 17:21:39 +0300
committerStanislau Wolski <stanislau.wolski@gmail.com>2013-05-30 17:21:39 +0300
commit7db8ad5ff3dcfe12e9c2044c55b93322f980f6a8 (patch)
treec4a4f321d968678a0f36be64aa51512f36d470f8 /codebase/db_common.php
parent5879c60d3f11c3dc828ce80cf3e41259693e1d5e (diff)
parenteb0386dd25a066532be6549a342e61d80c438477 (diff)
downloadconnector-php-7db8ad5ff3dcfe12e9c2044c55b93322f980f6a8.zip
connector-php-7db8ad5ff3dcfe12e9c2044c55b93322f980f6a8.tar.gz
connector-php-7db8ad5ff3dcfe12e9c2044c55b93322f980f6a8.tar.bz2
Merge branch 'master' of 192.168.1.251:connector-php
Diffstat (limited to 'codebase/db_common.php')
-rw-r--r--codebase/db_common.php20
1 files changed, 19 insertions, 1 deletions
diff --git a/codebase/db_common.php b/codebase/db_common.php
index 53f1999..76748e7 100644
--- a/codebase/db_common.php
+++ b/codebase/db_common.php
@@ -964,7 +964,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");