From e9a3e5b584784a566ec1ac033af4303c16930c7d Mon Sep 17 00:00:00 2001 From: nbm Date: Mon, 3 Jan 2005 11:44:51 +0000 Subject: [PATCH] Support having and not having the WHERE in the sWhereClause of getList, since it was not standardised. --- lib/ktentity.inc | 10 ++++++++++ 1 file changed, 10 insertions(+), 0 deletions(-) diff --git a/lib/ktentity.inc b/lib/ktentity.inc index d558f47..1ba5e1c 100644 --- a/lib/ktentity.inc +++ b/lib/ktentity.inc @@ -94,8 +94,18 @@ class KTEntityUtil { $aParams = array(); if (!is_null($sWhereClause)) { if (is_string($sWhereClause)) { + if (substr($sWhereClause, 0, 5) != 'WHERE') { + if (substr($sWhereClause, 0, 5) != 'ORDER') { + $sQuery .= ' WHERE'; + } + } $sQuery .= ' ' . $sWhereClause; } else if (is_array($sWhereClause)) { + if (substr($sWhereClause[0], 0, 5) != 'WHERE') { + if (substr($sWhereClause[0], 0, 5) != 'ORDER') { + $sQuery .= ' WHERE'; + } + } $sQuery .= ' ' . $sWhereClause[0]; $aParams = $sWhereClause[1]; } else { -- libgit2 0.21.4