public function addLinkbaseRef( $href, $title, $type = "simple", $role = "http://www.xbrl.org/2003/role/definitionLinkbaseRef", $arcrole="http://www.w3.org/1999/xlink/properties/linkbase", $base = "" )
	{
		$linkbaseRef = array(
				'type' => $type,
				'href' => XBRL::resolve_path( $this->schemaLocation, $href ),
				'role' => $role,
				'arcrole' => $arcrole,
				'title' => $title,
				'base' => $base,
		);

		$this->linkbaseTypes[ $role ][] = $linkbaseRef;

		$this->loadSuccess = false;
		$this->linkbasesProcessed = false;

		switch ( $role )
		{
			case XBRL_Constants::$PresentationLinkbaseRef:
				// $this->processPresentationLinkbases( $this->linkbaseTypes[ $role ] );
				$this->processPresentationLinkbase( $linkbaseRef );
				break;

			case XBRL_Constants::$LabelLinkbaseRef:
				// $this->processLabelLinkbases( $this->linkbaseTypes[ $role ] );
				$this->processLabelLinkbase( $linkbaseRef );
				break;

			case XBRL_Constants::$DefinitionLinkbaseRef:
				// $this->processDefinitionLinkbases( $this->linkbaseTypes[ $role ] );
				$this->processDefinitionLinkbase( $linkbaseRef );
				break;

			case XBRL_Constants::$CalculationLinkbaseRef:
				// $this->processCalculationLinkbases( $this->linkbaseTypes[ $role ] );
				$this->processCalculationLinkbase( $linkbaseRef );
				break;

			case XBRL_Constants::$ReferenceLinkbaseRef:
				// $this->processReferenceLinkbases( $linkbaseType );
				$this->processReferenceLinkbase( $linkbaseRef );
				break;

			default:
				// Handle custom linkbases
				$this->processCustomLinkbases( $this->linkbaseTypes[ $role ] );
				break;
		}

		$this->fixupDefinitionRoles(); // Mainly adds a 'paths' index to the 'hierarchy' element of each role.

		$this->linkbasesProcessed = true;
		$this->linkbasesProcessInProgress = false;

		if ( $this->xbrlDocument )
		{
			$this->validateTaxonomy21();
		}
		// BMS 2018-05-03 Changed pass 'true' because without it the directed cycle validation tests are not performed
		$this->validateDimensions( true );
		$this->validateCustom();

		$this->loadSuccess = true;

	}