Data\Filter: add isChain() and isExpression()

This makes node type distiction easier
This commit is contained in:
Thomas Gelf 2014-11-14 22:41:30 +01:00
parent 86cca8ff0b
commit ce7aea5df7
3 changed files with 24 additions and 0 deletions

View File

@ -22,6 +22,10 @@ abstract class Filter
return $this;
}
abstract public function isExpression();
abstract public function isChain();
abstract function toQueryString();
public function getUrlParams()

View File

@ -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);

View File

@ -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;