Permalink
Browse files

Fix prepared statement notices

  • Loading branch information...
1 parent c64d252 commit 7439de4b792128442a64657606da3690fcf2784d @cdekok committed Feb 21, 2013
Showing with 6 additions and 2 deletions.
  1. +6 −2 library/Zend/Db/Sql/Insert.php
@@ -168,13 +168,17 @@ public function prepareStatement(AdapterInterface $adapter, StatementContainerIn
foreach ($this->columns as $cIndex => $column) {
$columns[$cIndex] = $platform->quoteIdentifier($column);
- if ($this->values[$cIndex] instanceof Expression) {
+ if (isset($this->values[$cIndex]) && $this->values[$cIndex] instanceof Expression) {
$exprData = $this->processExpression($this->values[$cIndex], $platform, $driver);
$values[$cIndex] = $exprData->getSql();
$parameterContainer->merge($exprData->getParameterContainer());
} else {
$values[$cIndex] = $driver->formatParameterName($column);
- $parameterContainer->offsetSet($column, $this->values[$cIndex]);
+ if(isset($this->values[$cIndex])) {
+ $parameterContainer->offsetSet($column, $this->values[$cIndex]);
+ } else {
+ $parameterContainer->offsetSet($column, null);
+ }
}
}

0 comments on commit 7439de4

Please sign in to comment.