public static function buildStructure($array, Structure $structure)
    {
        switch ($structure->getType()) {
            case Structure::TYPE_LIST:
                $result = self::buildList($array, $structure);
                break;
            case Structure::TYPE_ARRAY:
                $result = self::buildArray($array, $structure);
                break;
            default:
                throw new Exception('Unknown structure type ' . $structure->getType());
        }

        return $result;
    }
public static function buildStructure($array, Structure $structure)
    {
        switch ($structure->getType()) {
            case Structure::TYPE_LIST:
                $result = self::buildList($array, $structure);
                break;
            case Structure::TYPE_ARRAY:
                $result = self::buildArray($array, $structure);
                break;
            default:
                throw new Exception('Unknown structure type ' . $structure->getType());
        }

        return $result;
    }
public static function buildStructure ( $ array , Structure $ structure ) { switch ( $ structure -> getType ( ) ) { case Structure :: TYPE_LIST : $ result = self :: buildList ( $ array , $ structure ) ; break ; case Structure :: TYPE_ARRAY : $ result = self :: buildArray ( $ array , $ structure ) ; break ; default : throw new Exception ( 'Unknown structure type ' . $ structure -> getType ( ) ) ; } return $ result ; }
Render array displayed as structure

@param array     $array
@param Structure $structure

@return string
@throws Exception
Render array displayed as structure