protected function doWalkConstraintComposite(AbstractNode $node, $method) { $children = $node->getChildren(); if (0 === count($children)) { throw new \InvalidArgumentException('Composite must have at least one constraint'); } if (1 === count($children)) { return $this->dispatch(current($children)); } $lConstraint = array_shift($children); $lPhpcrConstraint = $this->dispatch($lConstraint); $phpcrComposite = false; foreach ($children as $rConstraint) { $rPhpcrConstraint = $this->dispatch($rConstraint); $phpcrComposite = $this->qomf()->{$method}($lPhpcrConstraint, $rPhpcrConstraint); $lPhpcrConstraint = $phpcrComposite; } return $phpcrComposite; }
protected function doWalkConstraintComposite(AbstractNode $node, $method) { $children = $node->getChildren(); if (count($children) == 1) { $op = $this->dispatch(current($children)); return $op; } $lConstraint = array_shift($children); $lPhpcrConstraint = $this->dispatch($lConstraint); foreach ($children as $rConstraint) { $rPhpcrConstraint = $this->dispatch($rConstraint); $phpcrComposite = $this->qomf->{$method}($lPhpcrConstraint, $rPhpcrConstraint); $lPhpcrConstraint = $phpcrComposite; } return $phpcrComposite; }