XBRL.php
private function getPrimaryItemDRSForRole( $primaryItem, $roleUri )
	{
		if ( ! isset( $primaryItem[ $roleUri ] ) )
		{
			$this->log()->warning( "The role '$roleUri' does not exist in the requested primary item" );
			return array();
		}

		// Nothing to do if there are no hypercubes for the primary item
		if ( !isset( $primaryItem[ $roleUri ]['hypercubes'] ) || ! count( $primaryItem[ $roleUri ]['hypercubes'] ) )
		{
			return array();
		}

		$role = $this->getDefinitionRoleRef( $roleUri );
		if ( ! $role )
		{
			return array();
		}

		$primaryItemId = $primaryItem[ $roleUri ]['label'];

		$result = array();

		foreach ( $primaryItem[ $roleUri ]['hypercubes'] as $hypercubeId )
		{
			if ( ! $this->resolvePrimaryItemHypercubeDRS( $primaryItemId, $hypercubeId, $role ) )
			{
				// Something went wrong
				continue;
			}

			if ( ! isset( $this->resolvedDRSCache[ $roleUri ][ $hypercubeId ] ) )
			{
				// Probably not good
				continue;
			}

			$result[ $hypercubeId ][ $roleUri ] = $this->resolvedDRSCache[ $roleUri ][ $hypercubeId ];
		}

		return $result;
	}
private function getPrimaryItemDRSForRole( $primaryItem, $roleUri )
	{
		if ( ! isset( $primaryItem[ $roleUri ] ) )
		{
			$this->log()->warning( "The role '$roleUri' does not exist in the requested primary item" );
			return array();
		}

		// Nothing to do if there are no hypercubes for the primary item
		if ( !isset( $primaryItem[ $roleUri ]['hypercubes'] ) || ! count( $primaryItem[ $roleUri ]['hypercubes'] ) )
		{
			return array();
		}

		$role = $this->getDefinitionRoleRef( $roleUri );
		if ( ! $role )
		{
			return array();
		}

		$primaryItemId = $primaryItem[ $roleUri ]['label'];

		$result = array();

		foreach ( $primaryItem[ $roleUri ]['hypercubes'] as $hypercubeId )
		{
			if ( ! $this->resolvePrimaryItemHypercubeDRS( $primaryItemId, $hypercubeId, $role ) )
			{
				// Something went wrong
				continue;
			}

			if ( ! isset( $this->resolvedDRSCache[ $roleUri ][ $hypercubeId ] ) )
			{
				// Probably not good
				continue;
			}

			$result[ $hypercubeId ][ $roleUri ] = $this->resolvedDRSCache[ $roleUri ][ $hypercubeId ];
		}

		return $result;
	}
private function getPrimaryItemDRSForRole ( $ primaryItem , $ roleUri ) { if ( ! isset ( $ primaryItem [ $ roleUri ] ) ) { $ this -> log ( ) -> warning ( "The role '$roleUri' does not exist in the requested primary item" ) ; return array ( ) ; } // Nothing to do if there are no hypercubes for the primary item
 if ( ! isset ( $ primaryItem [ $ roleUri ] [ 'hypercubes' ] ) || ! count ( $ primaryItem [ $ roleUri ] [ 'hypercubes' ] ) ) { return array ( ) ; } $ role = $ this -> getDefinitionRoleRef ( $ roleUri ) ; if ( ! $ role ) { return array ( ) ; } $ primaryItemId = $ primaryItem [ $ roleUri ] [ 'label' ] ; $ result = array ( ) ; foreach ( $ primaryItem [ $ roleUri ] [ 'hypercubes' ] as $ hypercubeId ) { if ( ! $ this -> resolvePrimaryItemHypercubeDRS ( $ primaryItemId , $ hypercubeId , $ role ) ) { // Something went wrong
 continue ; } if ( ! isset ( $ this -> resolvedDRSCache [ $ roleUri ] [ $ hypercubeId ] ) ) { // Probably not good
 continue ; } $ result [ $ hypercubeId ] [ $ roleUri ] = $ this -> resolvedDRSCache [ $ roleUri ] [ $ hypercubeId ] ; } return $ result ; }
Called by getPrimaryItemDRS to retreive the DRS for a specific primary item in a specific role
@param array $primaryItem
@param string $roleUri
@return mixed
Called by getPrimaryItemDRS to retreive the DRS for a specific primary item in a specific role