PHP Classes
elePHPant
Icontem

File: application/modules/extensions/aws/Aws/Api/Serializer/Ec2ParamBuilder.php

Recommend this page to a friend!
  Classes of Tran Tuan  >  Pretty PHP S3 Files Manager  >  application/modules/extensions/aws/Aws/Api/Serializer/Ec2ParamBuilder.php  >  Download  
File: application/modules/extensions/aws/Aws/Api/Serializer/Ec2ParamBuilder.php
Role: Application script
Content type: text/plain
Description: Application script
Class: Pretty PHP S3 Files Manager
Web based interface to manage files in Amazon S3
Author: By
Last change:
Date: 3 years ago
Size: 859 bytes
 

 

Contents

Class file image Download
<?php
namespace Aws\Api\Serializer;

use
Aws\Api\Shape;
use
Aws\Api\ListShape;

/**
 * @internal
 */
class Ec2ParamBuilder extends QueryParamBuilder
{
    protected function
queryName(Shape $shape, $default = null)
    {
        return (
$shape['queryName']
            ?:
ucfirst($shape['locationName']))
                ?:
$default;
    }

    protected function
isFlat(Shape $shape)
    {
        return
false;
    }

    protected function
format_list(
       
ListShape $shape,
        array
$value,
       
$prefix,
        &
$query
   
) {
       
// Handle empty list serialization
       
if (!$value) {
           
$query[$prefix] = false;
        } else {
           
$items = $shape->getMember();
            foreach (
$value as $k => $v) {
               
$this->format($items, $v, $prefix . '.' . ($k + 1), $query);
            }
        }
    }
}