Skip to content

Commit

Permalink
For Select.php, added type information when limit and offset populate…
Browse files Browse the repository at this point in the history
… the parameter container set
  • Loading branch information
Ralph Schindler committed May 8, 2012
1 parent 31bf042 commit 3ece328
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
11 changes: 1 addition & 10 deletions Zend/Db/Adapter/ParameterContainer.php
Expand Up @@ -114,7 +114,6 @@ public function offsetSet($name, $value, $errata = null)
$names = array_keys($this->data);
$this->positions[array_search($name, $names)] = $name;

$this->errata[$name] = null;
if ($errata) {
$this->offsetSetErrata($name, $errata);
}
Expand Down Expand Up @@ -159,11 +158,6 @@ public function offsetSetErrata($name, $errata)
{
if (is_int($name)) {
$name = $this->positions[$name];
} else {
$name = $name;
}
if (!array_key_exists($name, $this->errata)) {
throw new \InvalidArgumentException('Data does not exist for this name/position');
}
$this->errata[$name] = $errata;
}
Expand All @@ -179,7 +173,7 @@ public function offsetGetErrata($name)
if (is_int($name)) {
$name = $this->positions[$name];
}
if (!array_key_exists($name, $this->errata)) {
if (!array_key_exists($name, $this->data)) {
throw new \InvalidArgumentException('Data does not exist for this name/position');
}
return $this->errata[$name];
Expand All @@ -196,9 +190,6 @@ public function offsetHasErrata($name)
if (is_int($name)) {
$name = $this->positions[$name];
}
if (!array_key_exists($name, $this->errata)) {
throw new \InvalidArgumentException('Data does not exist for this name/position');
}
return (isset($this->errata[$name]));
}

Expand Down
4 changes: 2 additions & 2 deletions Zend/Db/Sql/Select.php
Expand Up @@ -600,7 +600,7 @@ protected function processLimit(PlatformInterface $platform, Adapter $adapter =
if ($adapter) {
$driver = $adapter->getDriver();
$sql = $driver->formatParameterName('limit');
$parameterContainer->offsetSet('limit', $this->limit);
$parameterContainer->offsetSet('limit', $this->limit, ParameterContainer::TYPE_INTEGER);
} else {
$sql = $platform->quoteValue($this->limit);
}
Expand All @@ -614,7 +614,7 @@ protected function processOffset(PlatformInterface $platform, Adapter $adapter =
return null;
}
if ($adapter) {
$parameterContainer->offsetSet('offset', $this->offset);
$parameterContainer->offsetSet('offset', $this->offset, ParameterContainer::TYPE_INTEGER);
return array($adapter->getDriver()->formatParameterName('offset'));
} else {
return array($platform->quoteValue($this->offset));
Expand Down

0 comments on commit 3ece328

Please sign in to comment.