XBRL-Instance.php
public function getEntityForElement( $element )
	{
		if ( isset( $element['contextRef'] ) )
		{
			return $this->contexts[ $element['contextRef'] ]['entity']['identifier']['value'];
		}

		if ( isset( $element['tuple_elements'] ) )
		{
			foreach ( $element['tuple_elements'] as $elementKey => $tuple_elements )
			{
				foreach ( $tuple_elements as $tupleIndex => $tuple_element )
				{
					$result = $this->getEntityForElement( $tuple_element );
					if ( $result ) return $result;
				}
			}
		}

		throw new Exception( "The element '{$element['taxonomy_element']['id']}' has no context ref but also has no tuple members (getEntityForElement)" );
	}
public function getEntityForElement( $element )
	{
		if ( isset( $element['contextRef'] ) )
		{
			return $this->contexts[ $element['contextRef'] ]['entity']['identifier']['value'];
		}

		if ( isset( $element['tuple_elements'] ) )
		{
			foreach ( $element['tuple_elements'] as $elementKey => $tuple_elements )
			{
				foreach ( $tuple_elements as $tupleIndex => $tuple_element )
				{
					$result = $this->getEntityForElement( $tuple_element );
					if ( $result ) return $result;
				}
			}
		}

		throw new Exception( "The element '{$element['taxonomy_element']['id']}' has no context ref but also has no tuple members (getEntityForElement)" );
	}
public function getEntityForElement ( $ element ) { if ( isset ( $ element [ 'contextRef' ] ) ) { return $ this -> contexts [ $ element [ 'contextRef' ] ] [ 'entity' ] [ 'identifier' ] [ 'value' ] ; } if ( isset ( $ element [ 'tuple_elements' ] ) ) { foreach ( $ element [ 'tuple_elements' ] as $ elementKey => $ tuple_elements ) { foreach ( $ tuple_elements as $ tupleIndex => $ tuple_element ) { $ result = $ this -> getEntityForElement ( $ tuple_element ) ; if ( $ result ) return $ result ; } } } throw new Exception ( "The element '{$element['taxonomy_element']['id']}' has no context ref but also has no tuple members (getEntityForElement)" ) ; }
Get the entity of the element.  For a simple concept this is easy but for a tuple its necessary to look at the tuple elements
@param array $element
@return string The entity of the element
Get the entity of the element . For a simple concept this is easy but for a tuple its necessary to look at the tuple elements