private function getDimensionFromComponent( $variableSet, $dimQName, $dimElement, $context )
	{
		$typed = isset( $dimElement['typedDomainRef'] );

		// Could be in context or in the entity
		foreach ( Formula::$componentPaths as $path )
		{
			$component = $this->getComponentForPath( $path, $context );
			if ( ! $component ) continue;

			// Look for the dimension type but if not found try a different path
			if ( ! isset( $component[ $typed ? 'typedMember' : 'explicitMember' ] ) ) continue;

			foreach ( $component[ $typed ? 'typedMember' : 'explicitMember' ] as $dimension )
			{
				// See if the qname of the dimension is the same at the aspect QName
				$qname = qname( $dimension['dimension'], $variableSet->xbrlInstance->getInstanceNamespaces() );
				if ( ! $qname->equals( $dimQName ) ) continue;

				return $dimension;
			}
		}

		return array();
	}