/**
  * {@inheritdoc}
  */
 public function accept()
 {
     return $this->condition->matchItem($this->current());
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function describe()
 {
     return $this->condition ? 'item.parent(' . $this->condition->describe() . ')' : 'item.parent != null';
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 public function describe()
 {
     return sprintf('not %s', $this->condition->describe());
 }
Example #4
0
 /**
  * {@inheritdoc}
  */
 public function reduce(ConditionInterface $condition)
 {
     $item = $this->duplicate(false);
     $children = $item->getChildren();
     foreach ($this->children as $child) {
         if ($condition->matchItem($child)) {
             $children->add($child->reduce($condition));
         }
     }
     return $item;
 }