public function reorderChildren(Node $node)
{
$reorders = $node->getOrderCommands();
if (count($reorders) == 0) {
// should not happen but safe is safe
return;
}
$body = '';
$path = $node->getPath();
foreach ($reorders as $child => $destination) {
if (is_null($destination)) {
$body .= ">{$path}/{$child} : #last\r";
} else {
$body .= ">{$path}/{$child} : {$destination}#before\r";
}
}
$this->setJsopBody(trim($body));
}