XBRL-Formulas.php
private function validateLabels( $taxonomy, $target, $lang = 'en' )
	{
		$labelArcs = $taxonomy->getGenericArc( XBRL_Constants::$genericElementLabel, $target->extendedLinkRoleUri, $target->label, $target->path, null, $target->linkbase );
		if ( ! $labelArcs ) return true;

		// Find the filter resources
		foreach ( $labelArcs as $labelArc )
		{
			if ( $labelArc['path'] != $target->path ) continue;

			// TODO Handle preferred label by taking and using the preferred label role from the arc
			$result = $taxonomy->getGenericLabel( XBRL_Constants::$genericRoleLabel, $labelArc['to'], substr( $lang, 0, 2 ), $target->path );

			if ( ! $result ) continue;

			// The should be only one but make sure by taking the first.
			$textLabel = reset( $result );
			$target->description = $textLabel['text'];
		}

		return true;
	}
private function validateLabels( $taxonomy, $target, $lang = 'en' )
	{
		$labelArcs = $taxonomy->getGenericArc( XBRL_Constants::$genericElementLabel, $target->extendedLinkRoleUri, $target->label, $target->path, null, $target->linkbase );
		if ( ! $labelArcs ) return true;

		// Find the filter resources
		foreach ( $labelArcs as $labelArc )
		{
			if ( $labelArc['path'] != $target->path ) continue;

			// TODO Handle preferred label by taking and using the preferred label role from the arc
			$result = $taxonomy->getGenericLabel( XBRL_Constants::$genericRoleLabel, $labelArc['to'], substr( $lang, 0, 2 ), $target->path );

			if ( ! $result ) continue;

			// The should be only one but make sure by taking the first.
			$textLabel = reset( $result );
			$target->description = $textLabel['text'];
		}

		return true;
	}
private function validateLabels ( $ taxonomy , $ target , $ lang = 'en' ) { $ labelArcs = $ taxonomy -> getGenericArc ( XBRL_Constants :: $ genericElementLabel , $ target -> extendedLinkRoleUri , $ target -> label , $ target -> path , null , $ target -> linkbase ) ; if ( ! $ labelArcs ) return true ; // Find the filter resources
 foreach ( $ labelArcs as $ labelArc ) { if ( $ labelArc [ 'path' ] != $ target -> path ) continue ; // TODO Handle preferred label by taking and using the preferred label role from the arc
 $ result = $ taxonomy -> getGenericLabel ( XBRL_Constants :: $ genericRoleLabel , $ labelArc [ 'to' ] , substr ( $ lang , 0 , 2 ) , $ target -> path ) ; if ( ! $ result ) continue ; // The should be only one but make sure by taking the first.
 $ textLabel = reset ( $ result ) ; $ target -> description = $ textLabel [ 'text' ] ; } return true ; }
Add the label to a resource
@param XBRL $taxonomy
@param Variable|AssertionSet $target
@param string $lang
@return boolean
Add the label to a resource