Commit e9a3e5b584784a566ec1ac033af4303c16930c7d
1 parent
1e8876cf
Support having and not having the WHERE in the sWhereClause of getList,
since it was not standardised. git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3097 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
10 additions
and
0 deletions
lib/ktentity.inc
| @@ -94,8 +94,18 @@ class KTEntityUtil { | @@ -94,8 +94,18 @@ class KTEntityUtil { | ||
| 94 | $aParams = array(); | 94 | $aParams = array(); |
| 95 | if (!is_null($sWhereClause)) { | 95 | if (!is_null($sWhereClause)) { |
| 96 | if (is_string($sWhereClause)) { | 96 | if (is_string($sWhereClause)) { |
| 97 | + if (substr($sWhereClause, 0, 5) != 'WHERE') { | ||
| 98 | + if (substr($sWhereClause, 0, 5) != 'ORDER') { | ||
| 99 | + $sQuery .= ' WHERE'; | ||
| 100 | + } | ||
| 101 | + } | ||
| 97 | $sQuery .= ' ' . $sWhereClause; | 102 | $sQuery .= ' ' . $sWhereClause; |
| 98 | } else if (is_array($sWhereClause)) { | 103 | } else if (is_array($sWhereClause)) { |
| 104 | + if (substr($sWhereClause[0], 0, 5) != 'WHERE') { | ||
| 105 | + if (substr($sWhereClause[0], 0, 5) != 'ORDER') { | ||
| 106 | + $sQuery .= ' WHERE'; | ||
| 107 | + } | ||
| 108 | + } | ||
| 99 | $sQuery .= ' ' . $sWhereClause[0]; | 109 | $sQuery .= ' ' . $sWhereClause[0]; |
| 100 | $aParams = $sWhereClause[1]; | 110 | $aParams = $sWhereClause[1]; |
| 101 | } else { | 111 | } else { |