Data\Filter: add isChain() and isExpression()
This makes node type distiction easier
This commit is contained in:
parent
86cca8ff0b
commit
ce7aea5df7
|
@ -22,6 +22,10 @@ abstract class Filter
|
|||
return $this;
|
||||
}
|
||||
|
||||
abstract public function isExpression();
|
||||
|
||||
abstract public function isChain();
|
||||
|
||||
abstract function toQueryString();
|
||||
|
||||
public function getUrlParams()
|
||||
|
|
|
@ -166,6 +166,16 @@ abstract class FilterChain extends Filter
|
|||
}
|
||||
}
|
||||
|
||||
public function isExpression()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function isChain()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function isEmpty()
|
||||
{
|
||||
return empty($this->filters);
|
||||
|
|
|
@ -19,6 +19,16 @@ class FilterExpression extends Filter
|
|||
$this->expression = $expression;
|
||||
}
|
||||
|
||||
public function isExpression()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function isChain()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function isEmpty()
|
||||
{
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue