XBRL-Instance.php
private function validateNonDimensionMembers( $component, $contextId, $types, $componentName, &$data )
	{
		if ( empty( $component ) )
		{
			XBRL_Log::getInstance()->instance_validation(
				$componentName == XBRL_Constants::$xbrliScenario
					? "4.7.4"
					: "4.7.3.2", "A $componentName cannot be empty",
				array(
					'context' => $contextId,
				)
			);
			return false;
		}

		$qName = qname( $component['name'], $this->instance_namespaces );

		// BMS 2018-04-30 This is rubbish.  It's the elements inside the component that must not be in xbrli
		// The $component element cannot be in the xbrli namespace
		// if ( $qName->namespaceURI == XBRL_Constants::$standardPrefixes[ STANDARD_PREFIX_XBRLI ] )
		// {
		// 	XBRL_Log::getInstance()->instance_validation(
		// 		$componentName == 'scenario'
		// 			? "4.7.4"
		// 			: "4.7.3.2",
		// 		"A $componentName element cannot be in the xbrl instance namespace",
		// 		array(
		// 			'context' => $contextId,
		// 		)
		// 	);
		// 	return false;
		// }

		// Check the member is valid
		// Don't look for the element type in the types collection.
		// Look for it in the taxonomy element

		$taxonomy = $this->getInstanceTaxonomy()->getTaxonomyForNamespace( $qName->namespaceURI );
		if ( $taxonomy )
		{
			$element = $taxonomy->getElementByName( $qName->localName );
			if ( ! XBRL_Instance::isEmpty( $element, 'substitutionGroup' ) )
			{
				if ( $types->resolveToSubstitutionGroup( $element['substitutionGroup'], array( XBRL_Constants::$xbrliItem ) ) )
				{
					XBRL_Log::getInstance()->instance_validation(
						$componentName == 'scenario'
							? "4.7.4"
							: "4.7.3.2", "A $componentName cannot include an element that is in the xbrli:item substitution group",
						array(
							'context' => $contextId,
						)
					);
					return false;
				}
			}

			if ( $element && ( ! XBRL_Instance::isEmpty( $element, 'type' ) || isset( $element['types'] ) ) )
			{
				$type = XBRL_Instance::isEmpty( $element, 'type' )
					? ( count( $element['types'] ) ? $element['types'][0] : "" )
					: $element['type'];

				// If the schema type is a string lookup the type
				if ( is_string( $type ) )
				{
					$qName = qname( $type, $this->instance_namespaces + array( 'xbrli' => XBRL_Constants::$standardPrefixes[ STANDARD_PREFIX_XBRLI ] ) );
					$type = $types->getType( $qName->localName, $qName->prefix );
				}

				if ( is_array( $type ) )
				{
					if ( isset( $type['values'] ) )
					{
						// if ( in_array( $component['member'], $type['values'] ) )
						if ( in_array( $component['member'], array_map( function( $value ) { return $value['value']; }, $type['values'] ) ) )
						{
							return true;
						}

						XBRL_Log::getInstance()->instance_validation(
							$componentName == 'scenario'
							? "4.7.4"
							: "4.7.3.2",
							"The $componentName type/member is not valid",
							array(
								'context' => $contextId,
							)
						);
						return false;
					}
					else if ( isset( $type['sequence'] ) )
					{
						echo "seq\n";
					}
				}

			}
		}

		return true;
	}
private function validateNonDimensionMembers( $component, $contextId, $types, $componentName, &$data )
	{
		if ( empty( $component ) )
		{
			XBRL_Log::getInstance()->instance_validation(
				$componentName == XBRL_Constants::$xbrliScenario
					? "4.7.4"
					: "4.7.3.2", "A $componentName cannot be empty",
				array(
					'context' => $contextId,
				)
			);
			return false;
		}

		$qName = qname( $component['name'], $this->instance_namespaces );

		// BMS 2018-04-30 This is rubbish.  It's the elements inside the component that must not be in xbrli
		// The $component element cannot be in the xbrli namespace
		// if ( $qName->namespaceURI == XBRL_Constants::$standardPrefixes[ STANDARD_PREFIX_XBRLI ] )
		// {
		// 	XBRL_Log::getInstance()->instance_validation(
		// 		$componentName == 'scenario'
		// 			? "4.7.4"
		// 			: "4.7.3.2",
		// 		"A $componentName element cannot be in the xbrl instance namespace",
		// 		array(
		// 			'context' => $contextId,
		// 		)
		// 	);
		// 	return false;
		// }

		// Check the member is valid
		// Don't look for the element type in the types collection.
		// Look for it in the taxonomy element

		$taxonomy = $this->getInstanceTaxonomy()->getTaxonomyForNamespace( $qName->namespaceURI );
		if ( $taxonomy )
		{
			$element = $taxonomy->getElementByName( $qName->localName );
			if ( ! XBRL_Instance::isEmpty( $element, 'substitutionGroup' ) )
			{
				if ( $types->resolveToSubstitutionGroup( $element['substitutionGroup'], array( XBRL_Constants::$xbrliItem ) ) )
				{
					XBRL_Log::getInstance()->instance_validation(
						$componentName == 'scenario'
							? "4.7.4"
							: "4.7.3.2", "A $componentName cannot include an element that is in the xbrli:item substitution group",
						array(
							'context' => $contextId,
						)
					);
					return false;
				}
			}

			if ( $element && ( ! XBRL_Instance::isEmpty( $element, 'type' ) || isset( $element['types'] ) ) )
			{
				$type = XBRL_Instance::isEmpty( $element, 'type' )
					? ( count( $element['types'] ) ? $element['types'][0] : "" )
					: $element['type'];

				// If the schema type is a string lookup the type
				if ( is_string( $type ) )
				{
					$qName = qname( $type, $this->instance_namespaces + array( 'xbrli' => XBRL_Constants::$standardPrefixes[ STANDARD_PREFIX_XBRLI ] ) );
					$type = $types->getType( $qName->localName, $qName->prefix );
				}

				if ( is_array( $type ) )
				{
					if ( isset( $type['values'] ) )
					{
						// if ( in_array( $component['member'], $type['values'] ) )
						if ( in_array( $component['member'], array_map( function( $value ) { return $value['value']; }, $type['values'] ) ) )
						{
							return true;
						}

						XBRL_Log::getInstance()->instance_validation(
							$componentName == 'scenario'
							? "4.7.4"
							: "4.7.3.2",
							"The $componentName type/member is not valid",
							array(
								'context' => $contextId,
							)
						);
						return false;
					}
					else if ( isset( $type['sequence'] ) )
					{
						echo "seq\n";
					}
				}

			}
		}

		return true;
	}
private function validateNonDimensionMembers ( $ component , $ contextId , $ types , $ componentName , & $ data ) { if ( empty ( $ component ) ) { XBRL_Log :: getInstance ( ) -> instance_validation ( $ componentName == XBRL_Constants :: $ xbrliScenario ? "4.7.4" : "4.7.3.2" , "A $componentName cannot be empty" , array ( 'context' => $ contextId , ) ) ; return false ; } $ qName = qname ( $ component [ 'name' ] , $ this -> instance_namespaces ) ; // BMS 2018-04-30 This is rubbish.  It's the elements inside the component that must not be in xbrli
 // The $component element cannot be in the xbrli namespace
 // if ( $qName->namespaceURI == XBRL_Constants::$standardPrefixes[ STANDARD_PREFIX_XBRLI ] )
 // {
 // 	XBRL_Log::getInstance()->instance_validation(
 // 		$componentName == 'scenario'
 // 			? "4.7.4"
 // 			: "4.7.3.2",
 // 		"A $componentName element cannot be in the xbrl instance namespace",
 // 		array(
 // 			'context' => $contextId,
 // 		)
 // 	);
 // 	return false;
 // }
 // Check the member is valid
 // Don't look for the element type in the types collection.
 // Look for it in the taxonomy element
 $ taxonomy = $ this -> getInstanceTaxonomy ( ) -> getTaxonomyForNamespace ( $ qName -> namespaceURI ) ; if ( $ taxonomy ) { $ element = $ taxonomy -> getElementByName ( $ qName -> localName ) ; if ( ! XBRL_Instance :: isEmpty ( $ element , 'substitutionGroup' ) ) { if ( $ types -> resolveToSubstitutionGroup ( $ element [ 'substitutionGroup' ] , array ( XBRL_Constants :: $ xbrliItem ) ) ) { XBRL_Log :: getInstance ( ) -> instance_validation ( $ componentName == 'scenario' ? "4.7.4" : "4.7.3.2" , "A $componentName cannot include an element that is in the xbrli:item substitution group" , array ( 'context' => $ contextId , ) ) ; return false ; } } if ( $ element && ( ! XBRL_Instance :: isEmpty ( $ element , 'type' ) || isset ( $ element [ 'types' ] ) ) ) { $ type = XBRL_Instance :: isEmpty ( $ element , 'type' ) ? ( count ( $ element [ 'types' ] ) ? $ element [ 'types' ] [ 0 ] : "" ) : $ element [ 'type' ] ; // If the schema type is a string lookup the type
 if ( is_string ( $ type ) ) { $ qName = qname ( $ type , $ this -> instance_namespaces + array ( 'xbrli' => XBRL_Constants :: $ standardPrefixes [ STANDARD_PREFIX_XBRLI ] ) ) ; $ type = $ types -> getType ( $ qName -> localName , $ qName -> prefix ) ; } if ( is_array ( $ type ) ) { if ( isset ( $ type [ 'values' ] ) ) { // if ( in_array( $component['member'], $type['values'] ) )
 if ( in_array ( $ component [ 'member' ] , array_map ( function ( $ value ) { return $ value [ 'value' ] ; } , $ type [ 'values' ] ) ) ) { return true ; } XBRL_Log :: getInstance ( ) -> instance_validation ( $ componentName == 'scenario' ? "4.7.4" : "4.7.3.2" , "The $componentName type/member is not valid" , array ( 'context' => $ contextId , ) ) ; return false ; } else if ( isset ( $ type [ 'sequence' ] ) ) { echo "seq\n" ; } } } } return true ; }
Used to validate non-dimension segments and scenarios

@param array $component The explicit member information
@param string $contextId The id of the context
@param XBRL_Types $types
@param string $componentName The name of the component: scenario or segment
@param array|null $data An object of data created to pass information between function calls
@return boolean
Used to validate non - dimension segments and scenarios