Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix prepared statement notices

  • Loading branch information...
commit 7439de4b792128442a64657606da3690fcf2784d 1 parent c64d252
@Mech7 Mech7 authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 library/Zend/Db/Sql/Insert.php
View
8 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);
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.