XBRL.php
public function removeDefinitionArc( $roleUri, $from, $to )
	{
		if ( ! isset( $this->definitionRoleRefs[ $roleUri ] ) ) return false;

		if ( isset( $this->definitionRoleRefs[ $roleUri ]['primaryitems'][ $to ] ) )
		{
			unset( $this->definitionRoleRefs[ $roleUri ]['primaryitems'][ $to ] );
		}

		if ( isset( $this->definitionRoleRefs[ $roleUri ]['members'][ $to ] ) )
		{
			unset( $this->definitionRoleRefs[ $roleUri ]['members'][ $to ] );
		}

		if ( isset( $this->definitionRoleRefs[ $roleUri ]['dimensions'][ $to ] ) )
		{
			unset( $this->definitionRoleRefs[ $roleUri ]['dimensions'][ $to ] );
		}

		// BMS 2017-03-21 Not using the hierarchy any more so the reference to 'paths' is redundant
		return;

		$toFragment = parse_url( $to, PHP_URL_FRAGMENT );
		$fromFragment = parse_url( $from, PHP_URL_FRAGMENT );

		if ( isset( $this->definitionRoleRefs[ $roleUri ]['paths'][ $toFragment ] ) )
		{
			$paths = $this->definitionRoleRefs[ $roleUri ]['paths'][ $toFragment ];
			$me = $this;
			$this->processNodeByPath( $this->definitionRoleRefs[ $roleUri ]['hierarchy'], $paths, $from,
				function( &$node, $path, $parentKey ) use( &$me, $from, $to, $roleUri ) {

					if ( $node['label'] != $from && ! isset( $node['children'][ $to ] ) ) return;

					// If this node has children then they need to be removed!
					if ( isset( $node['children'][ $to ]['children'] ) )
					{
						foreach ( $node['children'][ $to ]['children'] as $childKey => $child )
						{
							$me->removeDefinitionArc( $roleUri, $to, $childKey );
						}
					}

					unset( $node['children'][ $to ] );
				}
			);
			unset( $me );

			/*
			foreach ( $paths as $path )
			{
				if ( isset( $current ) ) unset( $current );
				$current =& $this->definitionRoleRefs[ $roleUri ]['hierarchy'];
				$previous = null;
				$previousKey = null;
				$partsPath = "";

				// Use the path to find the hierarchy node to be removed
				$parts = explode( '/', $path );
				foreach ( $parts as $part )
				{
					if ( ! isset( $current[ $part ] ) )
					{
						break;
					}

					$previous =& $current;

					if ( ! empty( $partsPath ) ) $partsPath .= '/';
					$partsPath .= $part;

					$current =& $current[ $part ];

					if ( ! isset( $current['children'] ) || $current['label'] == $parts[ count( $parts ) - 1 ] )
					{
						break;
					}

					$current =& $current['children'];
					$previousKey = $part;
				}

				if ( $partsPath != $path )
				{
					continue;
				}

				// The label of $current should be $toFragment and the label of $previous should be $fromFragment
				if ( $current['label'] != $to )
				{
					continue;
				}

				if ( $previousKey != $from)
				{
					// This means the path contains the $to node but its parent on this path is not $from
					continue;
				}

				// If this node has children then they need to be removed!
				if ( isset( $current['children'] ) )
				{
					foreach ( $current['children'] as $childKey => $child )
					{
						$this->removeDefinitionArc( $roleUri, $to, $childKey );
					}
				}

				// Remove the arc
				unset( $previous[ $to ] );

			}
			*/

			// Remove the paths
			unset( $this->definitionRoleRefs[ $roleUri ]['paths'][ $toFragment ] );
		}

	}
public function removeDefinitionArc( $roleUri, $from, $to )
	{
		if ( ! isset( $this->definitionRoleRefs[ $roleUri ] ) ) return false;

		if ( isset( $this->definitionRoleRefs[ $roleUri ]['primaryitems'][ $to ] ) )
		{
			unset( $this->definitionRoleRefs[ $roleUri ]['primaryitems'][ $to ] );
		}

		if ( isset( $this->definitionRoleRefs[ $roleUri ]['members'][ $to ] ) )
		{
			unset( $this->definitionRoleRefs[ $roleUri ]['members'][ $to ] );
		}

		if ( isset( $this->definitionRoleRefs[ $roleUri ]['dimensions'][ $to ] ) )
		{
			unset( $this->definitionRoleRefs[ $roleUri ]['dimensions'][ $to ] );
		}

		// BMS 2017-03-21 Not using the hierarchy any more so the reference to 'paths' is redundant
		return;

		$toFragment = parse_url( $to, PHP_URL_FRAGMENT );
		$fromFragment = parse_url( $from, PHP_URL_FRAGMENT );

		if ( isset( $this->definitionRoleRefs[ $roleUri ]['paths'][ $toFragment ] ) )
		{
			$paths = $this->definitionRoleRefs[ $roleUri ]['paths'][ $toFragment ];
			$me = $this;
			$this->processNodeByPath( $this->definitionRoleRefs[ $roleUri ]['hierarchy'], $paths, $from,
				function( &$node, $path, $parentKey ) use( &$me, $from, $to, $roleUri ) {

					if ( $node['label'] != $from && ! isset( $node['children'][ $to ] ) ) return;

					// If this node has children then they need to be removed!
					if ( isset( $node['children'][ $to ]['children'] ) )
					{
						foreach ( $node['children'][ $to ]['children'] as $childKey => $child )
						{
							$me->removeDefinitionArc( $roleUri, $to, $childKey );
						}
					}

					unset( $node['children'][ $to ] );
				}
			);
			unset( $me );

			/*
			foreach ( $paths as $path )
			{
				if ( isset( $current ) ) unset( $current );
				$current =& $this->definitionRoleRefs[ $roleUri ]['hierarchy'];
				$previous = null;
				$previousKey = null;
				$partsPath = "";

				// Use the path to find the hierarchy node to be removed
				$parts = explode( '/', $path );
				foreach ( $parts as $part )
				{
					if ( ! isset( $current[ $part ] ) )
					{
						break;
					}

					$previous =& $current;

					if ( ! empty( $partsPath ) ) $partsPath .= '/';
					$partsPath .= $part;

					$current =& $current[ $part ];

					if ( ! isset( $current['children'] ) || $current['label'] == $parts[ count( $parts ) - 1 ] )
					{
						break;
					}

					$current =& $current['children'];
					$previousKey = $part;
				}

				if ( $partsPath != $path )
				{
					continue;
				}

				// The label of $current should be $toFragment and the label of $previous should be $fromFragment
				if ( $current['label'] != $to )
				{
					continue;
				}

				if ( $previousKey != $from)
				{
					// This means the path contains the $to node but its parent on this path is not $from
					continue;
				}

				// If this node has children then they need to be removed!
				if ( isset( $current['children'] ) )
				{
					foreach ( $current['children'] as $childKey => $child )
					{
						$this->removeDefinitionArc( $roleUri, $to, $childKey );
					}
				}

				// Remove the arc
				unset( $previous[ $to ] );

			}
			*/

			// Remove the paths
			unset( $this->definitionRoleRefs[ $roleUri ]['paths'][ $toFragment ] );
		}

	}
public function removeDefinitionArc ( $ roleUri , $ from , $ to ) { if ( ! isset ( $ this -> definitionRoleRefs [ $ roleUri ] ) ) return false ; if ( isset ( $ this -> definitionRoleRefs [ $ roleUri ] [ 'primaryitems' ] [ $ to ] ) ) { unset ( $ this -> definitionRoleRefs [ $ roleUri ] [ 'primaryitems' ] [ $ to ] ) ; } if ( isset ( $ this -> definitionRoleRefs [ $ roleUri ] [ 'members' ] [ $ to ] ) ) { unset ( $ this -> definitionRoleRefs [ $ roleUri ] [ 'members' ] [ $ to ] ) ; } if ( isset ( $ this -> definitionRoleRefs [ $ roleUri ] [ 'dimensions' ] [ $ to ] ) ) { unset ( $ this -> definitionRoleRefs [ $ roleUri ] [ 'dimensions' ] [ $ to ] ) ; } // BMS 2017-03-21 Not using the hierarchy any more so the reference to 'paths' is redundant
 return ; $ toFragment = parse_url ( $ to , PHP_URL_FRAGMENT ) ; $ fromFragment = parse_url ( $ from , PHP_URL_FRAGMENT ) ; if ( isset ( $ this -> definitionRoleRefs [ $ roleUri ] [ 'paths' ] [ $ toFragment ] ) ) { $ paths = $ this -> definitionRoleRefs [ $ roleUri ] [ 'paths' ] [ $ toFragment ] ; $ me = $ this ; $ this -> processNodeByPath ( $ this -> definitionRoleRefs [ $ roleUri ] [ 'hierarchy' ] , $ paths , $ from , function ( & $ node , $ path , $ parentKey ) use ( & $ me , $ from , $ to , $ roleUri ) { if ( $ node [ 'label' ] != $ from && ! isset ( $ node [ 'children' ] [ $ to ] ) ) return ; // If this node has children then they need to be removed!
 if ( isset ( $ node [ 'children' ] [ $ to ] [ 'children' ] ) ) { foreach ( $ node [ 'children' ] [ $ to ] [ 'children' ] as $ childKey => $ child ) { $ me -> removeDefinitionArc ( $ roleUri , $ to , $ childKey ) ; } } unset ( $ node [ 'children' ] [ $ to ] ) ; } ) ; unset ( $ me ) ; /*
			foreach ( $paths as $path )
			{
				if ( isset( $current ) ) unset( $current );
				$current =& $this->definitionRoleRefs[ $roleUri ]['hierarchy'];
				$previous = null;
				$previousKey = null;
				$partsPath = "";

				// Use the path to find the hierarchy node to be removed
				$parts = explode( '/', $path );
				foreach ( $parts as $part )
				{
					if ( ! isset( $current[ $part ] ) )
					{
						break;
					}

					$previous =& $current;

					if ( ! empty( $partsPath ) ) $partsPath .= '/';
					$partsPath .= $part;

					$current =& $current[ $part ];

					if ( ! isset( $current['children'] ) || $current['label'] == $parts[ count( $parts ) - 1 ] )
					{
						break;
					}

					$current =& $current['children'];
					$previousKey = $part;
				}

				if ( $partsPath != $path )
				{
					continue;
				}

				// The label of $current should be $toFragment and the label of $previous should be $fromFragment
				if ( $current['label'] != $to )
				{
					continue;
				}

				if ( $previousKey != $from)
				{
					// This means the path contains the $to node but its parent on this path is not $from
					continue;
				}

				// If this node has children then they need to be removed!
				if ( isset( $current['children'] ) )
				{
					foreach ( $current['children'] as $childKey => $child )
					{
						$this->removeDefinitionArc( $roleUri, $to, $childKey );
					}
				}

				// Remove the arc
				unset( $previous[ $to ] );

			}
			*/ // Remove the paths
 unset ( $ this -> definitionRoleRefs [ $ roleUri ] [ 'paths' ] [ $ toFragment ] ) ; } }
Removes an arc from the hierarchy and members or definitions list
@param string $roleUri
@param string $from
@param string $to
Removes an arc from the hierarchy and members or definitions list