From 1e6226045540dd17d83cdde8e9adc11092078e73 Mon Sep 17 00:00:00 2001 From: Neil Blakey-Milner Date: Fri, 28 Apr 2006 11:51:05 +0000 Subject: [PATCH] Allow for the field name to the different from the dictionary key (in case you need multiple constraints on a single key). --- lib/ktentity.inc | 6 ++++++ 1 file changed, 6 insertions(+), 0 deletions(-) diff --git a/lib/ktentity.inc b/lib/ktentity.inc index a82c0e9..883cf28 100644 --- a/lib/ktentity.inc +++ b/lib/ktentity.inc @@ -778,6 +778,11 @@ class KTEntityUtil { return array("$sField < ?", array($aParam)); } + function _getBy_between($sField, $aValue) { + $aParam = $aValue['value']; + return array("$sField BETWEEN ? AND ?", $aParam); + } + function &getBy($sClassName, $aField, $mValue, $aOptions = null) { $bMulti = KTUtil::arrayGet($aOptions, 'multi', false); if ($bMulti) { @@ -797,6 +802,7 @@ class KTEntityUtil { if (!is_array($mThisValue)) { $mThisValue = array('type' => 'equals', 'value' => $mThisValue); } + $sField = KTUtil::arrayGet($mThisValue, 'field', $sField); $sType = KTUtil::arrayGet($mThisValue, 'type'); if (empty($sType)) { -- libgit2 0.21.4