Formulas/Resources/Formulas/Aspects/EntityIdentifier.php
public function getValue( $variableSet, $evaluationResult, $log )
	{
		// Should already have been validated that if there is no source, there MUST be a complete entity identifier aspect is defined.
		if ( $this->source )
		{
			$sourceFact = $variableSet->getSourceFact( $this->source, $evaluationResult, ASPECT_ENTITY_IDENTIFIER, $log );
			if ( is_null( $sourceFact ) )
			{
				$source = is_array( $this->source ) ? "{$this->source['originalPrefix']}:{$this->source['name']}" : $this->source;
				$log->formula_validation( "Formula", "Invalid or missing source fact for entity identifier",
					array(
						'source' => $source,
						'error' => 'xbrlfe:undefinedSAV'
					)
				);
			}

			$contextRef = FactValues::getContextRef( $sourceFact );
			if ( ! $contextRef ) return null;
			$context = $variableSet->xbrlInstance->getContext( $contextRef );
			$identifier = isset( $context['entity']['identifier'] )
				? $context['entity']['identifier']
				: array();
		}

		if ( $this->scheme )
		{
			$result = $this->evaluateXPath( $variableSet, "{$this->scheme} cast as xs:string", $evaluationResult['vars'] );
			$identifier['scheme'] = is_object( $result ) ? $result->getValue() : $result;
		}

		if ( $this->value )
		{
			$result = $this->evaluateXPath( $variableSet, "({$this->value}) cast as xs:string", $evaluationResult['vars'] );
			$identifier['value'] = is_object( $result ) ? $result->getValue() : $result;
		}

		return $identifier;
	}
public function getValue( $variableSet, $evaluationResult, $log )
	{
		// Should already have been validated that if there is no source, there MUST be a complete entity identifier aspect is defined.
		if ( $this->source )
		{
			$sourceFact = $variableSet->getSourceFact( $this->source, $evaluationResult, ASPECT_ENTITY_IDENTIFIER, $log );
			if ( is_null( $sourceFact ) )
			{
				$source = is_array( $this->source ) ? "{$this->source['originalPrefix']}:{$this->source['name']}" : $this->source;
				$log->formula_validation( "Formula", "Invalid or missing source fact for entity identifier",
					array(
						'source' => $source,
						'error' => 'xbrlfe:undefinedSAV'
					)
				);
			}

			$contextRef = FactValues::getContextRef( $sourceFact );
			if ( ! $contextRef ) return null;
			$context = $variableSet->xbrlInstance->getContext( $contextRef );
			$identifier = isset( $context['entity']['identifier'] )
				? $context['entity']['identifier']
				: array();
		}

		if ( $this->scheme )
		{
			$result = $this->evaluateXPath( $variableSet, "{$this->scheme} cast as xs:string", $evaluationResult['vars'] );
			$identifier['scheme'] = is_object( $result ) ? $result->getValue() : $result;
		}

		if ( $this->value )
		{
			$result = $this->evaluateXPath( $variableSet, "({$this->value}) cast as xs:string", $evaluationResult['vars'] );
			$identifier['value'] = is_object( $result ) ? $result->getValue() : $result;
		}

		return $identifier;
	}
public function getValue ( $ variableSet , $ evaluationResult , $ log ) { // Should already have been validated that if there is no source, there MUST be a complete entity identifier aspect is defined.
 if ( $ this -> source ) { $ sourceFact = $ variableSet -> getSourceFact ( $ this -> source , $ evaluationResult , ASPECT_ENTITY_IDENTIFIER , $ log ) ; if ( is_null ( $ sourceFact ) ) { $ source = is_array ( $ this -> source ) ? "{$this->source['originalPrefix']}:{$this->source['name']}" : $ this -> source ; $ log -> formula_validation ( "Formula" , "Invalid or missing source fact for entity identifier" , array ( 'source' => $ source , 'error' => 'xbrlfe:undefinedSAV' ) ) ; } $ contextRef = FactValues :: getContextRef ( $ sourceFact ) ; if ( ! $ contextRef ) return null ; $ context = $ variableSet -> xbrlInstance -> getContext ( $ contextRef ) ; $ identifier = isset ( $ context [ 'entity' ] [ 'identifier' ] ) ? $ context [ 'entity' ] [ 'identifier' ] : array ( ) ; } if ( $ this -> scheme ) { $ result = $ this -> evaluateXPath ( $ variableSet , "{$this->scheme} cast as xs:string" , $ evaluationResult [ 'vars' ] ) ; $ identifier [ 'scheme' ] = is_object ( $ result ) ? $ result -> getValue ( ) : $ result ; } if ( $ this -> value ) { $ result = $ this -> evaluateXPath ( $ variableSet , "({$this->value}) cast as xs:string" , $ evaluationResult [ 'vars' ] ) ; $ identifier [ 'value' ] = is_object ( $ result ) ? $ result -> getValue ( ) : $ result ; } return $ identifier ; }
Returns an aspect value
@param Formula $variableSet
@param array $evaluationResult
@param \XBRL_Log $log
@return array
Returns an aspect value