summaryrefslogtreecommitdiffstats
path: root/codebase/db_common.php
diff options
context:
space:
mode:
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 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");