$existingParameters =
$this->
getParameters();
$newParameters =
new ArrayCollection();
foreach ($existingParameters as $existingParameter) { if (!
isset($parameters[$existingParameter->
getName()])) { $newParameters->
add($existingParameter);
} } foreach ($parameters as $key =>
$value) { $parameter =
new Parameter($key,
$value);
$newParameters->
add($parameter);
} $this->
setParameters($newParameters);
return $this;
} /**
* Adds filters to the query results.
*
* <code>
* $this->addFilter(array(
* 'name' => 'A%'
* ));
* </code>
*
* <code>
* $this->addFilter(array(array(
* 'property' => 'name'
* 'value' => 'A%'
* )));
* </code>
*
* <code>
* $this->addFilter(array(array(
* 'property' => 'number'
* 'expression' => '>',
* 'value' => '500'
* )));
* </code>
*
* @param array<string, mixed>|array<array{property: string, value: mixed, expression?: string, operator?: string|null}> $filter
*
* @return QueryBuilder
*/