XBRL.php
protected function fromStore( $data )
	{
		// Fix up the schema location
		if ( strpos( $data['schemaLocation'], '\\') !== false ) $data['schemaLocation'] = str_replace( '\\', '/', $data['schemaLocation'] );
		if ( strpos( $data['schemaLocation'], './') ) $data['schemaLocation'] = XBRL::normalizePath( $data['schemaLocation'] );

		$this->loadedFromJSON = true;

		$this->elementIndex			=& $data['elementIndex'];
		$this->elementHypercubes	=& $data['elementHypercubes'];
		$this->elementDimensions	=& $data['elementDimensions'];
		$this->schemaLocation		=& $data['schemaLocation'];
		$this->namespace			=& $data['namespace'];
		$this->roleTypes			=& $data['roleTypes'];
		if ( isset( $data['roleTypeIds'] ) )
		{
			$this->roleTypeIds			=& $data['roleTypeIds'];
		}
		$this->arcroleTypes			=& $data['arcroleTypes'];
		if ( isset( $data['arcroleTypeIds'] ) )
		{
			$this->arcroleTypeIds		=& $data['arcroleTypeIds'];
		}
		$this->linkbaseTypes		=& $data['linkbaseTypes'];
		$this->definitionRoleRefs	=& $data['definitionRoleRefs'];
		$this->referenceRoleRefs	=& $data['referenceRoleRefs'];
		$this->stringsLoaded		=  $data['stringsLoaded'];
		$this->documentPrefixes		=  $data['documentPrefixes'];
		$this->xdtTargetRoles		=& $data['xdtTargetRoles'];
		$this->genericRoles			=& $data['genericRoles'];
		$this->variableSetNames		=& $data['variableSetNames'];
		$this->linkbaseIds			=& $data['linkbaseIds'];
		$this->hasFormulas			=& $data['hasFormulas'];
		$this->linkbases			=& $data['linkbases'];

		if ( ( $key = array_search( $this->namespace, $this->documentPrefixes ) ) !== false )
		{
			$this->prefix = $key;
		}
		else
		{
			$this->log()->warning("A prefix cannot be found among the document prefixes for the namespace '{$this->namespace}'");
		}

		if ( isset( $data['extraElements'] ) )
		{
			foreach ( $data['extraElements'] as $newElementLabel => $existingElementLabel )
			{
				$existingElementTaxonomy = $this->getTaxonomyForXSD( $existingElementLabel );
				$element = $existingElementTaxonomy->getElementById( $existingElementLabel );

				$newElementTaxonomy = $this->getTaxonomyForXSD( $newElementLabel );
				$elements =& $newElementTaxonomy->getElements();
				$elements[ substr( strstr( $newElementLabel, '#' ), 1 ) ] = $elements[ $element['id'] ];
			}
		}

		// BMS 2018-09-09 Moved to $this->fixupForeignDefinitionsFromStore($schemas)
		// if ( isset( $data['foreignDefinitionRoleRefs'] ) && $data['foreignDefinitionRoleRefs'] )
		// {
		// 	foreach( $data['foreignDefinitionRoleRefs'] as $definitionRoleRefKey => $definitionRoleRef )
		// 	{
		// 		$home_taxonomy = $this->getTaxonomyForXSD( $definitionRoleRef['href'] );
		// 		if ( ! $home_taxonomy )
		// 		{
		// 			$ex = new \Exception("Unable to locate taxonomy instance for '{$definitionRoleRef['href']}'");
		// 			// error_log($ex->getTraceAsString());
		// 			throw $ex;
		// 		}
		// 		$roleRef =& $home_taxonomy->getDefinitionRoleRef( $definitionRoleRef['roleUri'] );
		// 		$roleRef = $this->mergeExtendedRoles( $roleRef, $definitionRoleRef, $mergedRoles, false );
		// 		$this->context->setPrimaryItemsCache( null );
		// 	}
		// }
	}
protected function fromStore( $data )
	{
		// Fix up the schema location
		if ( strpos( $data['schemaLocation'], '\\') !== false ) $data['schemaLocation'] = str_replace( '\\', '/', $data['schemaLocation'] );
		if ( strpos( $data['schemaLocation'], './') ) $data['schemaLocation'] = XBRL::normalizePath( $data['schemaLocation'] );

		$this->loadedFromJSON = true;

		$this->elementIndex			=& $data['elementIndex'];
		$this->elementHypercubes	=& $data['elementHypercubes'];
		$this->elementDimensions	=& $data['elementDimensions'];
		$this->schemaLocation		=& $data['schemaLocation'];
		$this->namespace			=& $data['namespace'];
		$this->roleTypes			=& $data['roleTypes'];
		if ( isset( $data['roleTypeIds'] ) )
		{
			$this->roleTypeIds			=& $data['roleTypeIds'];
		}
		$this->arcroleTypes			=& $data['arcroleTypes'];
		if ( isset( $data['arcroleTypeIds'] ) )
		{
			$this->arcroleTypeIds		=& $data['arcroleTypeIds'];
		}
		$this->linkbaseTypes		=& $data['linkbaseTypes'];
		$this->definitionRoleRefs	=& $data['definitionRoleRefs'];
		$this->referenceRoleRefs	=& $data['referenceRoleRefs'];
		$this->stringsLoaded		=  $data['stringsLoaded'];
		$this->documentPrefixes		=  $data['documentPrefixes'];
		$this->xdtTargetRoles		=& $data['xdtTargetRoles'];
		$this->genericRoles			=& $data['genericRoles'];
		$this->variableSetNames		=& $data['variableSetNames'];
		$this->linkbaseIds			=& $data['linkbaseIds'];
		$this->hasFormulas			=& $data['hasFormulas'];
		$this->linkbases			=& $data['linkbases'];

		if ( ( $key = array_search( $this->namespace, $this->documentPrefixes ) ) !== false )
		{
			$this->prefix = $key;
		}
		else
		{
			$this->log()->warning("A prefix cannot be found among the document prefixes for the namespace '{$this->namespace}'");
		}

		if ( isset( $data['extraElements'] ) )
		{
			foreach ( $data['extraElements'] as $newElementLabel => $existingElementLabel )
			{
				$existingElementTaxonomy = $this->getTaxonomyForXSD( $existingElementLabel );
				$element = $existingElementTaxonomy->getElementById( $existingElementLabel );

				$newElementTaxonomy = $this->getTaxonomyForXSD( $newElementLabel );
				$elements =& $newElementTaxonomy->getElements();
				$elements[ substr( strstr( $newElementLabel, '#' ), 1 ) ] = $elements[ $element['id'] ];
			}
		}

		// BMS 2018-09-09 Moved to $this->fixupForeignDefinitionsFromStore($schemas)
		// if ( isset( $data['foreignDefinitionRoleRefs'] ) && $data['foreignDefinitionRoleRefs'] )
		// {
		// 	foreach( $data['foreignDefinitionRoleRefs'] as $definitionRoleRefKey => $definitionRoleRef )
		// 	{
		// 		$home_taxonomy = $this->getTaxonomyForXSD( $definitionRoleRef['href'] );
		// 		if ( ! $home_taxonomy )
		// 		{
		// 			$ex = new \Exception("Unable to locate taxonomy instance for '{$definitionRoleRef['href']}'");
		// 			// error_log($ex->getTraceAsString());
		// 			throw $ex;
		// 		}
		// 		$roleRef =& $home_taxonomy->getDefinitionRoleRef( $definitionRoleRef['roleUri'] );
		// 		$roleRef = $this->mergeExtendedRoles( $roleRef, $definitionRoleRef, $mergedRoles, false );
		// 		$this->context->setPrimaryItemsCache( null );
		// 	}
		// }
	}
protected function fromStore ( $ data ) { // Fix up the schema location
 if ( strpos ( $ data [ 'schemaLocation' ] , '\\' ) !== false ) $ data [ 'schemaLocation' ] = str_replace ( '\\' , '/' , $ data [ 'schemaLocation' ] ) ; if ( strpos ( $ data [ 'schemaLocation' ] , './' ) ) $ data [ 'schemaLocation' ] = XBRL :: normalizePath ( $ data [ 'schemaLocation' ] ) ; $ this -> loadedFromJSON = true ; $ this -> elementIndex = & $ data [ 'elementIndex' ] ; $ this -> elementHypercubes = & $ data [ 'elementHypercubes' ] ; $ this -> elementDimensions = & $ data [ 'elementDimensions' ] ; $ this -> schemaLocation = & $ data [ 'schemaLocation' ] ; $ this -> namespace = & $ data [ 'namespace' ] ; $ this -> roleTypes = & $ data [ 'roleTypes' ] ; if ( isset ( $ data [ 'roleTypeIds' ] ) ) { $ this -> roleTypeIds = & $ data [ 'roleTypeIds' ] ; } $ this -> arcroleTypes = & $ data [ 'arcroleTypes' ] ; if ( isset ( $ data [ 'arcroleTypeIds' ] ) ) { $ this -> arcroleTypeIds = & $ data [ 'arcroleTypeIds' ] ; } $ this -> linkbaseTypes = & $ data [ 'linkbaseTypes' ] ; $ this -> definitionRoleRefs = & $ data [ 'definitionRoleRefs' ] ; $ this -> referenceRoleRefs = & $ data [ 'referenceRoleRefs' ] ; $ this -> stringsLoaded = $ data [ 'stringsLoaded' ] ; $ this -> documentPrefixes = $ data [ 'documentPrefixes' ] ; $ this -> xdtTargetRoles = & $ data [ 'xdtTargetRoles' ] ; $ this -> genericRoles = & $ data [ 'genericRoles' ] ; $ this -> variableSetNames = & $ data [ 'variableSetNames' ] ; $ this -> linkbaseIds = & $ data [ 'linkbaseIds' ] ; $ this -> hasFormulas = & $ data [ 'hasFormulas' ] ; $ this -> linkbases = & $ data [ 'linkbases' ] ; if ( ( $ key = array_search ( $ this -> namespace , $ this -> documentPrefixes ) ) !== false ) { $ this -> prefix = $ key ; } else { $ this -> log ( ) -> warning ( "A prefix cannot be found among the document prefixes for the namespace '{$this->namespace}'" ) ; } if ( isset ( $ data [ 'extraElements' ] ) ) { foreach ( $ data [ 'extraElements' ] as $ newElementLabel => $ existingElementLabel ) { $ existingElementTaxonomy = $ this -> getTaxonomyForXSD ( $ existingElementLabel ) ; $ element = $ existingElementTaxonomy -> getElementById ( $ existingElementLabel ) ; $ newElementTaxonomy = $ this -> getTaxonomyForXSD ( $ newElementLabel ) ; $ elements = & $ newElementTaxonomy -> getElements ( ) ; $ elements [ substr ( strstr ( $ newElementLabel , '#' ) , 1 ) ] = $ elements [ $ element [ 'id' ] ] ; } } // BMS 2018-09-09 Moved to $this->fixupForeignDefinitionsFromStore($schemas)
 // if ( isset( $data['foreignDefinitionRoleRefs'] ) && $data['foreignDefinitionRoleRefs'] )
 // {
 // 	foreach( $data['foreignDefinitionRoleRefs'] as $definitionRoleRefKey => $definitionRoleRef )
 // 	{
 // 		$home_taxonomy = $this->getTaxonomyForXSD( $definitionRoleRef['href'] );
 // 		if ( ! $home_taxonomy )
 // 		{
 // 			$ex = new \Exception("Unable to locate taxonomy instance for '{$definitionRoleRef['href']}'");
 // 			// error_log($ex->getTraceAsString());
 // 			throw $ex;
 // 		}
 // 		$roleRef =& $home_taxonomy->getDefinitionRoleRef( $definitionRoleRef['roleUri'] );
 // 		$roleRef = $this->mergeExtendedRoles( $roleRef, $definitionRoleRef, $mergedRoles, false );
 // 		$this->context->setPrimaryItemsCache( null );
 // 	}
 // }
 }
Populate an instance from stored data
@param array $data
Populate an instance from stored data