src/Axis/DynamicAxis.php
function setOrder(array $orderedNames, $parentName = null) {
    if (isset($parentName)) {
      if (!isset($this->children[$parentName])) {
        throw new \Exception("Unknown name '$parentName'.");
      }
      $this->children[$parentName] = $this->internalSetOrder(
        $this->children[$parentName],
        $orderedNames);
    }
    else {
      $this->toplevelNames = $this->internalSetOrder(
        $this->toplevelNames,
        $orderedNames);
    }
    return $this;
  }
function setOrder(array $orderedNames, $parentName = null) {
    if (isset($parentName)) {
      if (!isset($this->children[$parentName])) {
        throw new \Exception("Unknown name '$parentName'.");
      }
      $this->children[$parentName] = $this->internalSetOrder(
        $this->children[$parentName],
        $orderedNames);
    }
    else {
      $this->toplevelNames = $this->internalSetOrder(
        $this->toplevelNames,
        $orderedNames);
    }
    return $this;
  }
function setOrder ( array $ orderedNames , $ parentName = null ) { if ( isset ( $ parentName ) ) { if ( ! isset ( $ this -> children [ $ parentName ] ) ) { throw new \ Exception ( "Unknown name '$parentName'." ) ; } $ this -> children [ $ parentName ] = $ this -> internalSetOrder ( $ this -> children [ $ parentName ] , $ orderedNames ) ; } else { $ this -> toplevelNames = $ this -> internalSetOrder ( $ this -> toplevelNames , $ orderedNames ) ; } return $ this ; }
Sets the order for all children of a parent, or all toplevel names.
This operation cannot add or remove names, only reorder them. If names
would be added or removed, an exception is thrown instead.

@param string[] $orderedNames
@param string|null $parentName

@return $this
@throws \Exception
Sets the order for all children of a parent or all toplevel names . This operation cannot add or remove names only reorder them . If names would be added or removed an exception is thrown instead .