Data\Filter: add setters for all properties
To keep our filter editor simple we want our filters to handle also operations replacing themselves.
This commit is contained in:
parent
97f88bf636
commit
18e49f6b9a
|
@ -78,6 +78,14 @@ abstract class FilterChain extends Filter
|
|||
return $this->operatorName;
|
||||
}
|
||||
|
||||
public function setOperatorName($name)
|
||||
{
|
||||
if ($name !== $this->operatorName) {
|
||||
return Filter::chain($name, $this->filters);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getOperatorSymbol()
|
||||
{
|
||||
return $this->operatorSymbol;
|
||||
|
|
|
@ -41,6 +41,20 @@ class FilterExpression extends Filter
|
|||
return $this->expression;
|
||||
}
|
||||
|
||||
public function setExpression($expression)
|
||||
{
|
||||
$this->expression = $expression;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setSign($sign)
|
||||
{
|
||||
if ($sign !== $this->sign) {
|
||||
return Filter::expression($this->column, $sign, $this->expression);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
$expression = is_array($this->expression) ?
|
||||
|
|
Loading…
Reference in New Issue