XBRL.php
public function &getCalculationRoleRefs( $filter = array(), $sort = true )
	{
		// Make sure the filter is initialized and contains lowercase values
		if ( ! is_array( $filter ) ) $filter = array();
		$filter = array_flip( array_map( 'strtolower', $filter ) );

		$refs = $this->context->calculationRoleRefs;

		/**
		 * @var array $result
		 */
		$result = array();

		foreach ( $refs as $refKey => $ref )
		{
			// Apply the filter if one is provided
			if ( count( $filter ) && ! isset( $filter[ strtolower( $refKey ) ] ) ) continue;

			$result[ $refKey ] = $this->context->calculationRoleRefs[ $refKey ];

			$description = $this->getCalculationLinkRoleDescription( $ref );
			$result[ $refKey ]['text'] = $description ? $description : "";

			// Remove any prohibited arcs
			if ( isset( $result[ $refKey ]['calculations'] ) && count( $result[ $refKey ]['calculations'] ) )
			{
				$arcs =& $result[ $refKey ]['calculations'];
				foreach ( $arcs as $from => $targets )
				{
					foreach ( $targets as $to => $node )
					{
						if ( $node['use'] == XBRL_Constants::$xlinkUseOptional ) continue;
						unset( $arcs[ $from ][ $to ] );
					}

					if ( count( $arcs[ $from ] ) ) continue;
					unset( $arcs[ $from ] );
				}
			}
		}

		if ( $sort )
		{
			$this->sortRoleRefs( $result );
		}

		return $result;
	}
public function &getCalculationRoleRefs( $filter = array(), $sort = true )
	{
		// Make sure the filter is initialized and contains lowercase values
		if ( ! is_array( $filter ) ) $filter = array();
		$filter = array_flip( array_map( 'strtolower', $filter ) );

		$refs = $this->context->calculationRoleRefs;

		/**
		 * @var array $result
		 */
		$result = array();

		foreach ( $refs as $refKey => $ref )
		{
			// Apply the filter if one is provided
			if ( count( $filter ) && ! isset( $filter[ strtolower( $refKey ) ] ) ) continue;

			$result[ $refKey ] = $this->context->calculationRoleRefs[ $refKey ];

			$description = $this->getCalculationLinkRoleDescription( $ref );
			$result[ $refKey ]['text'] = $description ? $description : "";

			// Remove any prohibited arcs
			if ( isset( $result[ $refKey ]['calculations'] ) && count( $result[ $refKey ]['calculations'] ) )
			{
				$arcs =& $result[ $refKey ]['calculations'];
				foreach ( $arcs as $from => $targets )
				{
					foreach ( $targets as $to => $node )
					{
						if ( $node['use'] == XBRL_Constants::$xlinkUseOptional ) continue;
						unset( $arcs[ $from ][ $to ] );
					}

					if ( count( $arcs[ $from ] ) ) continue;
					unset( $arcs[ $from ] );
				}
			}
		}

		if ( $sort )
		{
			$this->sortRoleRefs( $result );
		}

		return $result;
	}
public function & getCalculationRoleRefs ( $ filter = array ( ) , $ sort = true ) { // Make sure the filter is initialized and contains lowercase values
 if ( ! is_array ( $ filter ) ) $ filter = array ( ) ; $ filter = array_flip ( array_map ( 'strtolower' , $ filter ) ) ; $ refs = $ this -> context -> calculationRoleRefs ; /**
		 * @var array $result
		 */ $ result = array ( ) ; foreach ( $ refs as $ refKey => $ ref ) { // Apply the filter if one is provided
 if ( count ( $ filter ) && ! isset ( $ filter [ strtolower ( $ refKey ) ] ) ) continue ; $ result [ $ refKey ] = $ this -> context -> calculationRoleRefs [ $ refKey ] ; $ description = $ this -> getCalculationLinkRoleDescription ( $ ref ) ; $ result [ $ refKey ] [ 'text' ] = $ description ? $ description : "" ; // Remove any prohibited arcs
 if ( isset ( $ result [ $ refKey ] [ 'calculations' ] ) && count ( $ result [ $ refKey ] [ 'calculations' ] ) ) { $ arcs = & $ result [ $ refKey ] [ 'calculations' ] ; foreach ( $ arcs as $ from => $ targets ) { foreach ( $ targets as $ to => $ node ) { if ( $ node [ 'use' ] == XBRL_Constants :: $ xlinkUseOptional ) continue ; unset ( $ arcs [ $ from ] [ $ to ] ) ; } if ( count ( $ arcs [ $ from ] ) ) continue ; unset ( $ arcs [ $ from ] ) ; } } } if ( $ sort ) { $ this -> sortRoleRefs ( $ result ) ; } return $ result ; }
Get the calculation links array for a role after adjusting for order and probibition
@param array|string $filter A list of the roles to include in the result.  If no filter is specified all roles are returned.
@param bool $sort True if the result list should be sorted
@return array
Get the calculation links array for a role after adjusting for order and probibition