public function addLabels( $locators, $arcs, $labels, $labelsByHref, $extendedLinkRole = null )
	{
		if ( is_null( $extendedLinkRole ) ) $extendedLinkRole = XBRL_Constants::$defaultLinkRole;
		$link = &$this->labels[ $extendedLinkRole ];

		$link['locators'] = isset( $link['locators'] ) && count( $link['locators'] )
			? array_merge( $link['locators'], $locators )
			: $locators;

		if ( isset( $link['arcs'] ) && count( $link['arcs'] ) )
		{
			$link['arcs'] = array_merge_recursive( $link['arcs'], $arcs );
			/*
			// Remove duplicates generated by the recursive merge function
			foreach ( $link['arcs'] as $label => &$labelLabels )
			{
				foreach ( $labelLabels as $labelLabel => $items )
				{
					if ( count( $items ) < 2 ) continue;

					$keep = array( $items[0] );
					for ( $i = 1; $i < Count( $items ); $i++ )
					{
						if (
								$items[0]['label'] === $items[ $i ]['label'] &&
								$items[0]['priority'] === $items[ $i ]['priority'] &&
								$items[0]['use'] === $items[ $i ]['use']
						   )
						{
							continue;
						}

						$keep[] = $items[ $i ];
					}

					$labelLabels[ $labelLabel ] = $keep;
				}
			}
			unset( $labelLabels );
			*/
		}
		else
		{
			$link['arcs'] = $arcs;
		}

		$link['labels'] = isset( $link['labels'] ) && count( $link['labels'] )
			? array_merge_recursive( $link['labels'], $labels )
			: $labels;

		$link['labelshref'] = isset( $link['labelshref'] ) && count( $link['labelshref'] )
			? array_merge_recursive( $link['labelshref'], $labelsByHref )
			: $labelsByHref;

		unset( $link );
	}