XBRL-Instance.php
public function isDimensionallyValid( $context, $hypercubeDimensions, $closed )
	{
		if ( is_string( $context ) )
		{
			$context = $this->getContext( $context );
		}

		// The context dimensions must be hypercube dimensions
		$contextDimensions = $this->getContextDimensions( $context );
		// $hypercubeDimensions = $details['details']['dimensions'];

		$invalidDimensions = array_diff_key( $contextDimensions, $hypercubeDimensions );

		// If there are any dimensions required by the context that are
		// not supported by the hypercube then the context is not valid
		if ( $invalidDimensions ) return false;

		// The dimension validity must take into account that any
		// of the hypercube dimension may have a default member
		$validDimensions = array_intersect_key( $contextDimensions, $hypercubeDimensions );

		if ( count( $validDimensions ) < count( $hypercubeDimensions ) )
		{
			// The order of the parameters is important.  The result should
			// have the missing members of the $reportInfoDimensions array.
			$missingDimensions = array_diff_key( $hypercubeDimensions, $validDimensions );

			// If there are no defaults an all missing dimensions then lose this context
			foreach ( $missingDimensions as $dimensionId => $dimension )
			{
				if ( ! isset( $dimension['default'] ) ) return false;
			}
		}
		elseif ( count( $contextDimensions ) > count( $hypercubeDimensions ) )
		{
			// If there are more context dimensions than report info dimensions then the dimension match is wrong
			return false;
		}

		return true;
	}
public function isDimensionallyValid( $context, $hypercubeDimensions, $closed )
	{
		if ( is_string( $context ) )
		{
			$context = $this->getContext( $context );
		}

		// The context dimensions must be hypercube dimensions
		$contextDimensions = $this->getContextDimensions( $context );
		// $hypercubeDimensions = $details['details']['dimensions'];

		$invalidDimensions = array_diff_key( $contextDimensions, $hypercubeDimensions );

		// If there are any dimensions required by the context that are
		// not supported by the hypercube then the context is not valid
		if ( $invalidDimensions ) return false;

		// The dimension validity must take into account that any
		// of the hypercube dimension may have a default member
		$validDimensions = array_intersect_key( $contextDimensions, $hypercubeDimensions );

		if ( count( $validDimensions ) < count( $hypercubeDimensions ) )
		{
			// The order of the parameters is important.  The result should
			// have the missing members of the $reportInfoDimensions array.
			$missingDimensions = array_diff_key( $hypercubeDimensions, $validDimensions );

			// If there are no defaults an all missing dimensions then lose this context
			foreach ( $missingDimensions as $dimensionId => $dimension )
			{
				if ( ! isset( $dimension['default'] ) ) return false;
			}
		}
		elseif ( count( $contextDimensions ) > count( $hypercubeDimensions ) )
		{
			// If there are more context dimensions than report info dimensions then the dimension match is wrong
			return false;
		}

		return true;
	}
public function isDimensionallyValid ( $ context , $ hypercubeDimensions , $ closed ) { if ( is_string ( $ context ) ) { $ context = $ this -> getContext ( $ context ) ; } // The context dimensions must be hypercube dimensions
 $ contextDimensions = $ this -> getContextDimensions ( $ context ) ; // $hypercubeDimensions = $details['details']['dimensions'];
 $ invalidDimensions = array_diff_key ( $ contextDimensions , $ hypercubeDimensions ) ; // If there are any dimensions required by the context that are
 // not supported by the hypercube then the context is not valid
 if ( $ invalidDimensions ) return false ; // The dimension validity must take into account that any
 // of the hypercube dimension may have a default member
 $ validDimensions = array_intersect_key ( $ contextDimensions , $ hypercubeDimensions ) ; if ( count ( $ validDimensions ) < count ( $ hypercubeDimensions ) ) { // The order of the parameters is important.  The result should
 // have the missing members of the $reportInfoDimensions array.
 $ missingDimensions = array_diff_key ( $ hypercubeDimensions , $ validDimensions ) ; // If there are no defaults an all missing dimensions then lose this context
 foreach ( $ missingDimensions as $ dimensionId => $ dimension ) { if ( ! isset ( $ dimension [ 'default' ] ) ) return false ; } } elseif ( count ( $ contextDimensions ) > count ( $ hypercubeDimensions ) ) { // If there are more context dimensions than report info dimensions then the dimension match is wrong
 return false ; } return true ; }
Tests whether a context is valid for the dimensions of a hypercube
@param array|string $context
@param array $hypercubeDimensions
@param boolean $closed
@return boolean
Tests whether a context is valid for the dimensions of a hypercube