Optimized getParameter.
This commit is contained in:
parent
1635e0af4b
commit
79ff1f10d2
@ -166,14 +166,15 @@ abstract class AbstractQuery
|
||||
*/
|
||||
public function getParameter($key)
|
||||
{
|
||||
foreach ($this->parameters->getIterator() as $parameter) {
|
||||
// Must not be identical because of string to integer conversion
|
||||
if ($parameter->getName() == $key) {
|
||||
return $parameter;
|
||||
$filteredParameters = $this->parameters->filter(
|
||||
function ($parameter) use ($key)
|
||||
{
|
||||
// Must not be identical because of string to integer conversion
|
||||
return ($key == $parameter->getName());
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
return null;
|
||||
return count($filteredParameters) ? $filteredParameters->first() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user