diff --git a/routeSQL.php b/routeSQL.php index 2ef00af..955c251 100644 --- a/routeSQL.php +++ b/routeSQL.php @@ -336,7 +336,7 @@ class routeSQL if ($this->chained !== null) $foreignSelect = array (array ($this->chainedForeign, $chain)); if ($search === "") - $datas = $this->objectDB->read (null, array_keys($titles), null, null, + $data = $this->objectDB->read (null, array_keys($titles), null, null, $foreignSelect); else { @@ -354,11 +354,11 @@ class routeSQL $s = "$s%"; $criteria[] = array ($column, "$s", "LIKE"); } - $datas = $this->objectDB->read ($criteria, array_keys ($titles), null, + $data = $this->objectDB->read ($criteria, array_keys ($titles), null, true, $foreignSelect); } - $this->renderrest ($extension, $datas); + $this->renderrest ($extension, $data); }); $route->post ("rest/".$this->url_prefix."(\.{extension})?", @@ -646,7 +646,7 @@ class routeSQL if ($this->chained !== null) $foreignSelect = array (array ($this->chainedForeign, $chain)); if ($search === "") - $datas = $this->objectDB->read (null, array_keys($titles), null, null, + $data = $this->objectDB->read (null, array_keys($titles), null, null, $foreignSelect); else { @@ -664,10 +664,10 @@ class routeSQL $s = "$s%"; $criteria[] = array ($column, "$s", "LIKE"); } - $datas = $this->objectDB->read ($criteria, array_keys ($titles), null, + $data = $this->objectDB->read ($criteria, array_keys ($titles), null, true, $foreignSelect); } - $nbentries = count ($datas); + $nbentries = count ($data); if ($num > 1000) $route->redirect ("/".str_replace ("{chain}", $chain, $this->url_prefix) ."?page=$page&num=1000&search=$search", ""); @@ -762,7 +762,7 @@ class routeSQL { $i = 1; $odd = "odd"; - foreach ($datas as $line) + foreach ($data as $line) { if ($i <= (($page-1)*$num) || $i > (($page-1)*$num + $num)) { @@ -1354,10 +1354,10 @@ class routeSQL Return FALSE in the other cases */ public function keyexists ($id) { - $datas = $this->objectDB->read (array (array ($this->objectDB->primary, + $data = $this->objectDB->read (array (array ($this->objectDB->primary, $id))); - if (count ($datas) > 0) - return $datas[0]; + if (count ($data) > 0) + return $data[0]; return FALSE; }