Skip to content

Commit

Permalink
fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Sep 1, 2023
1 parent cbdb1c9 commit daa576a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Model/Scope.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function addCondition($field, $operator = null, $value = null)
return $this;
}

protected function setSystem($system = true)
protected function setSystem(bool $system = true)
{
foreach ($this->elements as $nestedCondition) {
$nestedCondition->setSystem($system && $this->isAnd());
Expand Down
7 changes: 5 additions & 2 deletions src/Model/Scope/AbstractScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,17 @@ protected function init(): void
$this->_init();

// always set system flag if condition added to another condition
$this->setSystem($this->owner instanceof RootScope);
$this->setSystem($owner instanceof RootScope);

$this->onChangeModel();
}

abstract protected function onChangeModel(): void;

abstract protected function setSystem($system = true);
/**
* @return $this
*/
abstract protected function setSystem(bool $system = true);

/**
* Get the model this condition is associated with.
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Scope/Condition.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function __construct($key, $operator = null, $value = null)
}
}

protected function setSystem($system = true)
protected function setSystem(bool $system = true)
{
$this->system = $system;

Expand Down

0 comments on commit daa576a

Please sign in to comment.