Formulas/Resources/Formulas/Aspects/Unit.php
private function getFactorsFromSource( $source, $variableSet, $evaluationResult, $log, &$numerators, &$denominators, &$unitRef = null )
	{
		$sourceFact = $variableSet->getSourceFactWithErrorLogging( $source, $evaluationResult, ASPECT_UNIT, $log );

		// If the rule is to augment the existing values fill the numerators and denominator arrays
		$unitRef = FactValues::getUnitRef( $sourceFact );
		if (! $unitRef ) return;

		$unit = $variableSet->xbrlInstance->getUnit( $unitRef );

		if ( is_array( $unit ) )
		{
			if ( isset( $unit['measures'] ) )
			{
				$numerators = array_merge( $numerators, $unit['measures'] );
			}

			if ( isset( $unit['divide'] ) )
			{
				if ( $unit['divide']['numerators'] )
				{
					$numerators = array_merge( $numerators, $unit['divide']['numerators'] );
				}

				if ( $unit['divide']['denominators'] )
				{
					$denominators = array_merge( $denominators, $unit['divide']['denominators'] );
				}
			}
		}
		else
		{
			$numerators[] = $unit;
		}
	}
private function getFactorsFromSource( $source, $variableSet, $evaluationResult, $log, &$numerators, &$denominators, &$unitRef = null )
	{
		$sourceFact = $variableSet->getSourceFactWithErrorLogging( $source, $evaluationResult, ASPECT_UNIT, $log );

		// If the rule is to augment the existing values fill the numerators and denominator arrays
		$unitRef = FactValues::getUnitRef( $sourceFact );
		if (! $unitRef ) return;

		$unit = $variableSet->xbrlInstance->getUnit( $unitRef );

		if ( is_array( $unit ) )
		{
			if ( isset( $unit['measures'] ) )
			{
				$numerators = array_merge( $numerators, $unit['measures'] );
			}

			if ( isset( $unit['divide'] ) )
			{
				if ( $unit['divide']['numerators'] )
				{
					$numerators = array_merge( $numerators, $unit['divide']['numerators'] );
				}

				if ( $unit['divide']['denominators'] )
				{
					$denominators = array_merge( $denominators, $unit['divide']['denominators'] );
				}
			}
		}
		else
		{
			$numerators[] = $unit;
		}
	}
private function getFactorsFromSource ( $ source , $ variableSet , $ evaluationResult , $ log , & $ numerators , & $ denominators , & $ unitRef = null ) { $ sourceFact = $ variableSet -> getSourceFactWithErrorLogging ( $ source , $ evaluationResult , ASPECT_UNIT , $ log ) ; // If the rule is to augment the existing values fill the numerators and denominator arrays
 $ unitRef = FactValues :: getUnitRef ( $ sourceFact ) ; if ( ! $ unitRef ) return ; $ unit = $ variableSet -> xbrlInstance -> getUnit ( $ unitRef ) ; if ( is_array ( $ unit ) ) { if ( isset ( $ unit [ 'measures' ] ) ) { $ numerators = array_merge ( $ numerators , $ unit [ 'measures' ] ) ; } if ( isset ( $ unit [ 'divide' ] ) ) { if ( $ unit [ 'divide' ] [ 'numerators' ] ) { $ numerators = array_merge ( $ numerators , $ unit [ 'divide' ] [ 'numerators' ] ) ; } if ( $ unit [ 'divide' ] [ 'denominators' ] ) { $ denominators = array_merge ( $ denominators , $ unit [ 'divide' ] [ 'denominators' ] ) ; } } } else { $ numerators [ ] = $ unit ; } }
Fill the numerators and denominators arrays from the specified source
@param array $source An array containing the qname of the source to use
@param Formula $variableSet
@param array $evaluationResult
@param \XBRL_Log $log
@param array $numerators List to populate with numerators
@param array $denominators List to populate with denominators
@param string The unitRef of the source (if there is one)
@return null
@throws An exception if the source is not valid
Fill the numerators and denominators arrays from the specified source