|
|
@@ -1228,6 +1228,7 @@ abstract class Zend_Db_Table_Abstract
|
|
|
$whereList = array();
|
|
|
$numberTerms = 0;
|
|
|
foreach ($args as $keyPosition => $keyValues) {
|
|
|
+ $keyValuesCount = count($keyValues);
|
|
|
// Coerce the values to an array.
|
|
|
// Don't simply typecast to array, because the values
|
|
|
// might be Zend_Db_Expr objects.
|
|
|
@@ -1235,12 +1236,13 @@ abstract class Zend_Db_Table_Abstract
|
|
|
$keyValues = array($keyValues);
|
|
|
}
|
|
|
if ($numberTerms == 0) {
|
|
|
- $numberTerms = count($keyValues);
|
|
|
- } else if (count($keyValues) != $numberTerms) {
|
|
|
+ $numberTerms = $keyValuesCount;
|
|
|
+ } else if ($keyValuesCount != $numberTerms) {
|
|
|
require_once 'Zend/Db/Table/Exception.php';
|
|
|
throw new Zend_Db_Table_Exception("Missing value(s) for the primary key");
|
|
|
}
|
|
|
- for ($i = 0; $i < count($keyValues); ++$i) {
|
|
|
+ $keyValues = array_values($keyValues);
|
|
|
+ for ($i = 0; $i < $keyValuesCount; ++$i) {
|
|
|
if (!isset($whereList[$i])) {
|
|
|
$whereList[$i] = array();
|
|
|
}
|