18 private $objectManager;
23 private $queryModifiers;
33 array $queryModifiers = []
36 $this->queryModifiers = $queryModifiers;
49 if (!isset($this->queryModifiers[
$type])) {
50 throw new \InvalidArgumentException(
'Unknown query modifier type ' .
$type);
52 $queryModifier = $this->objectManager->create($this->queryModifiers[
$type],
$data);
54 throw new \InvalidArgumentException(
55 $this->queryModifiers[
$type] .
' must implement ' . QueryModifierInterface::class
58 return $queryModifier;
create($type, array $data=[])
__construct(ObjectManagerInterface $objectManager, array $queryModifiers=[])