XBRL.php
public function getPrimaryItemDRS( $primaryItem )
	{
		$result = array();

		foreach ( $primaryItem['roles'] as $roleUri )
		{
			// $result = array_merge( $result, $this->getPrimaryItemDRSForRole( $primaryItem, $roleUri ) );
			$roleResult =  $this->getPrimaryItemDRSForRole( $primaryItem, $roleUri );
			foreach ( $roleResult as $hypercubeId => $roleHypercube )
			{
				if ( ! isset( $result[ $hypercubeId ] ) )
				{
					$result[ $hypercubeId ] = $roleHypercube;
					continue;
				}

				foreach ( $roleHypercube as $role => $hypercube )
				{
					$result[ $hypercubeId ][ $role ] = $hypercube;
				}

			}
		}

		return $result;
	}
public function getPrimaryItemDRS( $primaryItem )
	{
		$result = array();

		foreach ( $primaryItem['roles'] as $roleUri )
		{
			// $result = array_merge( $result, $this->getPrimaryItemDRSForRole( $primaryItem, $roleUri ) );
			$roleResult =  $this->getPrimaryItemDRSForRole( $primaryItem, $roleUri );
			foreach ( $roleResult as $hypercubeId => $roleHypercube )
			{
				if ( ! isset( $result[ $hypercubeId ] ) )
				{
					$result[ $hypercubeId ] = $roleHypercube;
					continue;
				}

				foreach ( $roleHypercube as $role => $hypercube )
				{
					$result[ $hypercubeId ][ $role ] = $hypercube;
				}

			}
		}

		return $result;
	}
public function getPrimaryItemDRS ( $ primaryItem ) { $ result = array ( ) ; foreach ( $ primaryItem [ 'roles' ] as $ roleUri ) { // $result = array_merge( $result, $this->getPrimaryItemDRSForRole( $primaryItem, $roleUri ) );
 $ roleResult = $ this -> getPrimaryItemDRSForRole ( $ primaryItem , $ roleUri ) ; foreach ( $ roleResult as $ hypercubeId => $ roleHypercube ) { if ( ! isset ( $ result [ $ hypercubeId ] ) ) { $ result [ $ hypercubeId ] = $ roleHypercube ; continue ; } foreach ( $ roleHypercube as $ role => $ hypercube ) { $ result [ $ hypercubeId ] [ $ role ] = $ hypercube ; } } } return $ result ; }
Create DRSs for a primary item across all its roles
@param array $primaryItem An array of elements which are the roles in which the primary item appears.
The array also includes an element 'roles' which is a list of all the roles.
@return array An array of hypercubes of the form [ $hypercubeId ][ $roleUri ][]
Create DRSs for a primary item across all its roles