XBRL-Formulas.php
private function evaluate( $variableSet )
	{
		if ( ! $this->canEvaluate ) return;
		if ( isset( $variableSet->evaluated ) ) return true;

		// Process the variables in hierarchy order
		// $variableSet->parameters =& $this->parameterQnames;
		$variableSet->nsMgr = $this->nsMgr;
		$variableSet->xbrlInstance = $this->instances[ $this->instanceQName->clarkNotation() ];
		if ( $variableSet->evaluate() )
		{
			// If the variable set is a formula then add a facts container
			if ( $variableSet instanceof Formula )
			{
				if ( is_null( $this->formulaFactsContainer ) ) $this->formulaFactsContainer = new GeneratedFacts();
				$variableSet->factsContainer = $this->formulaFactsContainer;
			}

			$variableSet->ProcessEvaluationResult( $this->log );

			// If the variable set is a formula recover the facts container
			if ( $variableSet instanceof Formula )
			{
				// This is probably redundant because the container instance will be passed to the variable set by reference
				$this->formulaFactsContainer = $variableSet->factsContainer;
			}
		}

		$variableSet->evaluated = true;

		return true;
	}
private function evaluate( $variableSet )
	{
		if ( ! $this->canEvaluate ) return;
		if ( isset( $variableSet->evaluated ) ) return true;

		// Process the variables in hierarchy order
		// $variableSet->parameters =& $this->parameterQnames;
		$variableSet->nsMgr = $this->nsMgr;
		$variableSet->xbrlInstance = $this->instances[ $this->instanceQName->clarkNotation() ];
		if ( $variableSet->evaluate() )
		{
			// If the variable set is a formula then add a facts container
			if ( $variableSet instanceof Formula )
			{
				if ( is_null( $this->formulaFactsContainer ) ) $this->formulaFactsContainer = new GeneratedFacts();
				$variableSet->factsContainer = $this->formulaFactsContainer;
			}

			$variableSet->ProcessEvaluationResult( $this->log );

			// If the variable set is a formula recover the facts container
			if ( $variableSet instanceof Formula )
			{
				// This is probably redundant because the container instance will be passed to the variable set by reference
				$this->formulaFactsContainer = $variableSet->factsContainer;
			}
		}

		$variableSet->evaluated = true;

		return true;
	}
private function evaluate ( $ variableSet ) { if ( ! $ this -> canEvaluate ) return ; if ( isset ( $ variableSet -> evaluated ) ) return true ; // Process the variables in hierarchy order
 // $variableSet->parameters =& $this->parameterQnames;
 $ variableSet -> nsMgr = $ this -> nsMgr ; $ variableSet -> xbrlInstance = $ this -> instances [ $ this -> instanceQName -> clarkNotation ( ) ] ; if ( $ variableSet -> evaluate ( ) ) { // If the variable set is a formula then add a facts container
 if ( $ variableSet instanceof Formula ) { if ( is_null ( $ this -> formulaFactsContainer ) ) $ this -> formulaFactsContainer = new GeneratedFacts ( ) ; $ variableSet -> factsContainer = $ this -> formulaFactsContainer ; } $ variableSet -> ProcessEvaluationResult ( $ this -> log ) ; // If the variable set is a formula recover the facts container
 if ( $ variableSet instanceof Formula ) { // This is probably redundant because the container instance will be passed to the variable set by reference
 $ this -> formulaFactsContainer = $ variableSet -> factsContainer ; } } $ variableSet -> evaluated = true ; return true ; }
Evaluate the formula. At the moment the instanceQNames points to the current instance being processed
@param VariableSet $variableSet
@return bool
Evaluate the formula . At the moment the instanceQNames points to the current instance being processed