forked from science-ation/science-ation
- Allow the tableeditor subclass to return an empty array for the WHERE clause,
and handle that case.
This commit is contained in:
parent
57dfb7df27
commit
e71d3c0bbb
@ -945,7 +945,6 @@ class TableEditor
|
|||||||
if(is_callable(array($this->classname, 'tableEditorGetList'))) {
|
if(is_callable(array($this->classname, 'tableEditorGetList'))) {
|
||||||
list($sel, $from, $where) = call_user_func(array($this->classname, 'tableEditorGetList'), &$this);
|
list($sel, $from, $where) = call_user_func(array($this->classname, 'tableEditorGetList'), &$this);
|
||||||
} else {
|
} else {
|
||||||
echo "Calling default func\n";
|
|
||||||
list($sel, $from, $where) = $this->defaultGetList();
|
list($sel, $from, $where) = $this->defaultGetList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -953,7 +952,9 @@ class TableEditor
|
|||||||
$query .= " FROM ";
|
$query .= " FROM ";
|
||||||
foreach($from as $f) $query .= "$f ";
|
foreach($from as $f) $query .= "$f ";
|
||||||
$query .= " WHERE 1 ";
|
$query .= " WHERE 1 ";
|
||||||
foreach($where as $w) $query .= "AND $w ";
|
if(is_array($where)) {
|
||||||
|
foreach($where as $w) $query .= "AND $w ";
|
||||||
|
}
|
||||||
|
|
||||||
if($this->sortField())
|
if($this->sortField())
|
||||||
$query.=" ORDER BY ".$this->sortField()."";
|
$query.=" ORDER BY ".$this->sortField()."";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user