/**
* @param string $nodePathOrIdentifier
* @return PropertyConditionGenerator
*/
public function isDescendantNodeOf($nodePathOrIdentifier)
{
if (preg_match(UuidValidator::PATTERN_MATCH_UUID, $nodePathOrIdentifier) === 1) {
$node = $this->getNodeByIdentifier($nodePathOrIdentifier);
if ($node === null) {
return new FalseConditionGenerator();
}
$nodePath = $node->getPath();
} else {
$nodePath = rtrim($nodePathOrIdentifier, '/');
}
$propertyConditionGenerator1 = new PropertyConditionGenerator('path');
$propertyConditionGenerator2 = new PropertyConditionGenerator('path');
return new DisjunctionGenerator(array($propertyConditionGenerator1->like($nodePath . '/%'), $propertyConditionGenerator2->equals($nodePath)));
}