Skip to content

Commit

Permalink
[update] always update system property on nested conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
georgehristov committed Aug 8, 2020
1 parent 21827e5 commit 1b9f276
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Model/Scope.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,8 @@ public function addCondition($field, $operator = null, $value = null)

protected function setSystem($system = true)
{
if ($this->isAnd()) {
foreach ($this->elements as $nestedCondition) {
$nestedCondition->setSystem($system);
}
foreach ($this->elements as $nestedCondition) {
$nestedCondition->setSystem($system && $this->isAnd());
}

return $this;
Expand Down

0 comments on commit 1b9f276

Please sign in to comment.