XBRL.php
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;

	}
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;

	}
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 ; }
This function is to support the conformance suites.  Some test creators have been lazy
in my view by creating one schema document that is to be use in multiple test where
each test has a different linkbase file.  Instead of create a clone of the core schema
and adding relevant linkbase reference they use the testcase instructions to load a
linkbase.

@param string $href The linkbase file to load
@param string $title The title to use
@param string $type (default: simple)
@param string $role (default: http://www.xbrl.org/2003/role/definitionLinkbaseRef)
@param string $arcrole (default: http://www.w3.org/1999/xlink/properties/linkbase)
@param string $base (default: )
This function is to support the conformance suites . Some test creators have been lazy in my view by creating one schema document that is to be use in multiple test where each test has a different linkbase file . Instead of create a clone of the core schema and adding relevant linkbase reference they use the testcase instructions to load a linkbase .