/**
  * {@inheritdoc}
  */
 public function accept()
 {
     return $this->condition->matchItem($this->current());
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 public function describe()
 {
     return $this->condition ? 'item.parent(' . $this->condition->describe() . ')' : 'item.parent != null';
 }
示例#3
0
 /**
  * {@inheritdoc}
  */
 public function describe()
 {
     return sprintf('not %s', $this->condition->describe());
 }
示例#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;
 }