예제 #1
0
 /**
  * {@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;
 }