Returns the orderBefore commands to be applied to the childnodes
to get from the original order to the new one
public getOrderCommands ( ) : array | ||
return | array | of arrays with 2 fields: name of node to order before second name |
/** * {@inheritDoc} */ 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)); }