Formulas/Resources/Variables/Implementation.php
public function execute( $signature, $context, $provider, $args, $parameters )
	{
		if ( count( $args ) != count( $this->inputs ) )
		{
			\XBRL_Log::getInstance()->formula_validation(
				"Custom function",
				"The number of parameters passed does not match the number of inputs expected",
				array(
					'error' => 'xbrlcfie:inputMismatch',
					'name' => "{$signature->name['originalPrefix']}:{$signature->name['name']}"
				)
			);
		}

		$vars = array();
		foreach ( $this->inputs as $key => $name )
		{
			$vars[ $name ] = $args[ $key ];
		}

		foreach ( $parameters as $qname => $parameter )
		{
			$vars[ $qname ] = $parameter->select;
		}

		$variableSet = new VariableSet();
		$variableSet->xbrlInstance = $context->xbrlInstance;
		$variableSet->xbrlTaxonomy = $context->xbrlTaxonomy;
		$variableSet->nsMgr = $context->NamespaceManager;

		foreach ( $this->steps as $name => $step )
		{
			$result = $this->evaluateXPath( $variableSet, $step, $vars );
			$vars[ $name ] = $result;
		}

		return $this->evaluateXPath( $variableSet, $this->output, $vars );
	}
public function execute( $signature, $context, $provider, $args, $parameters )
	{
		if ( count( $args ) != count( $this->inputs ) )
		{
			\XBRL_Log::getInstance()->formula_validation(
				"Custom function",
				"The number of parameters passed does not match the number of inputs expected",
				array(
					'error' => 'xbrlcfie:inputMismatch',
					'name' => "{$signature->name['originalPrefix']}:{$signature->name['name']}"
				)
			);
		}

		$vars = array();
		foreach ( $this->inputs as $key => $name )
		{
			$vars[ $name ] = $args[ $key ];
		}

		foreach ( $parameters as $qname => $parameter )
		{
			$vars[ $qname ] = $parameter->select;
		}

		$variableSet = new VariableSet();
		$variableSet->xbrlInstance = $context->xbrlInstance;
		$variableSet->xbrlTaxonomy = $context->xbrlTaxonomy;
		$variableSet->nsMgr = $context->NamespaceManager;

		foreach ( $this->steps as $name => $step )
		{
			$result = $this->evaluateXPath( $variableSet, $step, $vars );
			$vars[ $name ] = $result;
		}

		return $this->evaluateXPath( $variableSet, $this->output, $vars );
	}
public function execute ( $ signature , $ context , $ provider , $ args , $ parameters ) { if ( count ( $ args ) != count ( $ this -> inputs ) ) { \ XBRL_Log :: getInstance ( ) -> formula_validation ( "Custom function" , "The number of parameters passed does not match the number of inputs expected" , array ( 'error' => 'xbrlcfie:inputMismatch' , 'name' => "{$signature->name['originalPrefix']}:{$signature->name['name']}" ) ) ; } $ vars = array ( ) ; foreach ( $ this -> inputs as $ key => $ name ) { $ vars [ $ name ] = $ args [ $ key ] ; } foreach ( $ parameters as $ qname => $ parameter ) { $ vars [ $ qname ] = $ parameter -> select ; } $ variableSet = new VariableSet ( ) ; $ variableSet -> xbrlInstance = $ context -> xbrlInstance ; $ variableSet -> xbrlTaxonomy = $ context -> xbrlTaxonomy ; $ variableSet -> nsMgr = $ context -> NamespaceManager ; foreach ( $ this -> steps as $ name => $ step ) { $ result = $ this -> evaluateXPath ( $ variableSet , $ step , $ vars ) ; $ vars [ $ name ] = $ result ; } return $ this -> evaluateXPath ( $ variableSet , $ this -> output , $ vars ) ; }
Execute the implementation
@param Signature $signature
@param XPath2Context $context
@param NodeProvider $provider
@param array $args
@param array[Parameter] $parameters
@return mixed
Execute the implementation