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