function addPath($Path, array $Descriptions = null)
	{
	    if ($Path[0] !== "/")
	        throw new \Exception ("The path supplied is not valid.");

	    $Path = substr ( $Path, 1 );
	    $Parts = explode ( "/", $Path );
	    $Parent = 1;
	    $index = 0;
	    $CurrentPath = "";
	    $NodesCreated = 0;

	    foreach ($Parts as $p)
	    {
	        if (isset ($Descriptions[$index]))
	            $Description = $Descriptions[$index];
	        else
	            $Description = "";
	        $CurrentPath .= "/{$p}";
	        $t = $this->pathId($CurrentPath);
	        if (! $t)
	        {
	            $IID = $this->add($p, $Description, $Parent);
	            $Parent = $IID;
	            $NodesCreated++;
	        }
	        else
	        {
	            $Parent = $t;
	        }

	        $index += 1;
	    }

	    return (int)$NodesCreated;
	}
function addPath($Path, array $Descriptions = null)
	{
	    if ($Path[0] !== "/")
	        throw new \Exception ("The path supplied is not valid.");

	    $Path = substr ( $Path, 1 );
	    $Parts = explode ( "/", $Path );
	    $Parent = 1;
	    $index = 0;
	    $CurrentPath = "";
	    $NodesCreated = 0;

	    foreach ($Parts as $p)
	    {
	        if (isset ($Descriptions[$index]))
	            $Description = $Descriptions[$index];
	        else
	            $Description = "";
	        $CurrentPath .= "/{$p}";
	        $t = $this->pathId($CurrentPath);
	        if (! $t)
	        {
	            $IID = $this->add($p, $Description, $Parent);
	            $Parent = $IID;
	            $NodesCreated++;
	        }
	        else
	        {
	            $Parent = $t;
	        }

	        $index += 1;
	    }

	    return (int)$NodesCreated;
	}
function addPath ( $ Path , array $ Descriptions = null ) { if ( $ Path [ 0 ] !== "/" ) throw new \ Exception ( "The path supplied is not valid." ) ; $ Path = substr ( $ Path , 1 ) ; $ Parts = explode ( "/" , $ Path ) ; $ Parent = 1 ; $ index = 0 ; $ CurrentPath = "" ; $ NodesCreated = 0 ; foreach ( $ Parts as $ p ) { if ( isset ( $ Descriptions [ $ index ] ) ) $ Description = $ Descriptions [ $ index ] ; else $ Description = "" ; $ CurrentPath .= "/{$p}" ; $ t = $ this -> pathId ( $ CurrentPath ) ; if ( ! $ t ) { $ IID = $ this -> add ( $ p , $ Description , $ Parent ) ; $ Parent = $ IID ; $ NodesCreated ++ ; } else { $ Parent = $ t ; } $ index += 1 ; } return ( int ) $ NodesCreated ; }
Adds a path and all its components.
Will not replace or create siblings if a component exists.

@param string $Path
such as /some/role/some/where - Must begin with a / (slash)
@param array $Descriptions
array of descriptions (will add with empty description if not available)

@return integer Number of nodes created (0 if none created)
Adds a path and all its components . Will not replace or create siblings if a component exists .