Skip to content

Commit

Permalink
different way for new pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
narcoticfresh committed Mar 22, 2024
1 parent ad46875 commit 859d8bc
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Graviton/RestBundle/Listener/RestrictionListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public function onPreAggregate(PreAggregateEvent $event)
$matchConditions[] = [
'$or' => [
[$fieldName => null],
[$fieldName => ['$lte' => $fieldValue]],
[$fieldName => ['$lte' => (int) $fieldValue]], // always int
]
];
} else {
Expand All @@ -246,10 +246,11 @@ public function onPreAggregate(PreAggregateEvent $event)
$newPipeline[] = ['$project' => $projectStage];
}

$newPipeline = array_merge(
$newPipeline,
$event->getPipeline()
);
if (is_array($event->getPipeline())) {
foreach ($event->getPipeline() as $stage) {
$newPipeline[] = $stage;
}
}

$this->logger->info(
'RESTRICTION onPreAggregate',
Expand Down

0 comments on commit 859d8bc

Please sign in to comment.