Merge branch 'master' into htmlDocs_response

This commit is contained in:
xming 2016-05-06 13:57:27 +08:00
commit ea14b3b559
22 changed files with 947 additions and 441 deletions

View File

@ -46,7 +46,7 @@ use \ArrayAccess;
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
* @link https://github.com/swagger-api/swagger-codegen
*/
class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayAccess
class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}implements ArrayAccess
{
/**
* The original name of the model.
@ -64,7 +64,7 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA
);
static function swaggerTypes() {
return self::$swaggerTypes{{#parent}} + parent::swaggerTypes(){{/parent}};
return self::$swaggerTypes{{#parentSchema}} + parent::swaggerTypes(){{/parentSchema}};
}
/**
@ -77,7 +77,7 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA
);
static function attributeMap() {
return {{#parent}}parent::attributeMap() + {{/parent}}self::$attributeMap;
return {{#parentSchema}}parent::attributeMap() + {{/parentSchema}}self::$attributeMap;
}
/**
@ -90,7 +90,7 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA
);
static function setters() {
return {{#parent}}parent::setters() + {{/parent}}self::$setters;
return {{#parentSchema}}parent::setters() + {{/parentSchema}}self::$setters;
}
/**
@ -103,7 +103,7 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA
);
static function getters() {
return {{#parent}}parent::getters() + {{/parent}}self::$getters;
return {{#parentSchema}}parent::getters() + {{/parentSchema}}self::$getters;
}
{{#vars}}{{#isEnum}}{{#allowableValues}}{{#enumVars}}const {{datatypeWithEnum}}_{{{name}}} = {{{value}}};
@ -122,13 +122,17 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA
}
{{/isEnum}}{{/vars}}
{{#vars}}
/**
* ${{name}} {{#description}}{{{description}}}{{/description}}
* @var {{datatype}}
* Associative array for storing property values
* @var mixed[]
*/
protected ${{name}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}};
{{/vars}}
protected $container = array({{#vars}}
/**
* $container['{{{name}}}']{{#description}} {{{description}}}{{/description}}
* @var {{datatype}}
*/
'{{{name}}}' => {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}},
{{/vars}});
/**
* Constructor
@ -136,14 +140,14 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA
*/
public function __construct(array $data = null)
{
{{#parent}}parent::__construct($data);{{/parent}}
{{#parentSchema}}parent::__construct($data);{{/parentSchema}}
{{#discriminator}}// Initialize discriminator property with the model name.
$discrimintor = array_search('{{discriminator}}', self::$attributeMap);
$this->{$discrimintor} = static::$swaggerModelName;
$this->container[$discrimintor] = static::$swaggerModelName;
{{/discriminator}}
if ($data != null) {
{{#vars}}$this->{{name}} = $data["{{name}}"];{{#hasMore}}
{{#vars}}$this->container['{{name}}'] = $data['{{name}}'];{{#hasMore}}
{{/hasMore}}{{/vars}}
}
}
@ -154,7 +158,7 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA
*/
public function {{getter}}()
{
return $this->{{name}};
return $this->container['{{name}}'];
}
/**
@ -164,11 +168,11 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA
*/
public function {{setter}}(${{name}})
{
{{#isEnum}}$allowed_values = array({{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}});
{{#isEnum}}$allowed_values = array({{#allowableValues}}{{#values}}'{{{this}}}'{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}});
if (!in_array(${{{name}}}, $allowed_values)) {
throw new \InvalidArgumentException("Invalid value for '{{name}}', must be one of {{#allowableValues}}{{#values}}'{{{this}}}'{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}");
}{{/isEnum}}
$this->{{name}} = ${{name}};
$this->container['{{name}}'] = ${{name}};
return $this;
}
{{/vars}}
@ -179,7 +183,7 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA
*/
public function offsetExists($offset)
{
return isset($this->$offset);
return isset($this->container[$offset]);
}
/**
@ -189,7 +193,7 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA
*/
public function offsetGet($offset)
{
return $this->$offset;
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
@ -200,7 +204,11 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA
*/
public function offsetSet($offset, $value)
{
$this->$offset = $value;
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
@ -210,7 +218,7 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA
*/
public function offsetUnset($offset)
{
unset($this->$offset);
unset($this->container[$offset]);
}
/**

View File

@ -842,6 +842,10 @@ definitions:
properties:
className:
type: string
AnimalFarm:
type: array
items:
$ref: '#/definitions/Animal'
format_test:
type: object
required:

View File

@ -5,7 +5,7 @@ This PHP package is automatically generated by the [Swagger Codegen](https://git
- API version: 1.0.0
- Package version: 1.0.0
- Build date: 2016-04-27T17:54:12.143+08:00
- Build date: 2016-05-06T10:33:16.765+08:00
- Build package: class io.swagger.codegen.languages.PhpClientCodegen
## Requirements
@ -22,11 +22,11 @@ To install the bindings via [Composer](http://getcomposer.org/), add the followi
"repositories": [
{
"type": "git",
"url": "https://github.com/YOUR_GIT_USR_ID/YOUR_GIT_REPO_ID.git"
"url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
}
],
"require": {
"YOUR_GIT_USR_ID/YOUR_GIT_REPO_ID": "*@dev"
"GIT_USER_ID/GIT_REPO_ID": "*@dev"
}
}
```
@ -59,7 +59,7 @@ Please follow the [installation procedure](#installation--usage) and then run th
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\FakeApi();
$number = "number_example"; // string | None
$number = 3.4; // float | None
$double = 1.2; // double | None
$string = "string_example"; // string | None
$byte = "B"; // string | None
@ -113,6 +113,7 @@ Class | Method | HTTP request | Description
## Documentation For Models
- [Animal](docs/Animal.md)
- [AnimalFarm](docs/AnimalFarm.md)
- [ApiResponse](docs/ApiResponse.md)
- [Cat](docs/Cat.md)
- [Category](docs/Category.md)

View File

@ -0,0 +1,9 @@
# AnimalFarm
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -60,7 +60,7 @@ class FakeApi
* Constructor
* @param \Swagger\Client\ApiClient|null $apiClient The api client to use
*/
function __construct($apiClient = null)
function __construct(\Swagger\Client\ApiClient $apiClient = null)
{
if ($apiClient == null) {
$apiClient = new ApiClient();
@ -84,7 +84,7 @@ class FakeApi
* @param \Swagger\Client\ApiClient $apiClient set the API client
* @return FakeApi
*/
public function setApiClient(ApiClient $apiClient)
public function setApiClient(\Swagger\Client\ApiClient $apiClient)
{
$this->apiClient = $apiClient;
return $this;

View File

@ -105,10 +105,16 @@ class Animal implements ArrayAccess
/**
* $class_name
* @var string
* Associative array for storing property values
* @var mixed[]
*/
protected $class_name;
protected $container = array(
/**
* $container['class_name']
* @var string
*/
'class_name' => null,
);
/**
* Constructor
@ -119,10 +125,10 @@ class Animal implements ArrayAccess
// Initialize discriminator property with the model name.
$discrimintor = array_search('className', self::$attributeMap);
$this->{$discrimintor} = static::$swaggerModelName;
$this->container[$discrimintor] = static::$swaggerModelName;
if ($data != null) {
$this->class_name = $data["class_name"];
$this->container['class_name'] = $data['class_name'];
}
}
/**
@ -131,7 +137,7 @@ class Animal implements ArrayAccess
*/
public function getClassName()
{
return $this->class_name;
return $this->container['class_name'];
}
/**
@ -142,7 +148,7 @@ class Animal implements ArrayAccess
public function setClassName($class_name)
{
$this->class_name = $class_name;
$this->container['class_name'] = $class_name;
return $this;
}
/**
@ -152,7 +158,7 @@ class Animal implements ArrayAccess
*/
public function offsetExists($offset)
{
return isset($this->$offset);
return isset($this->container[$offset]);
}
/**
@ -162,7 +168,7 @@ class Animal implements ArrayAccess
*/
public function offsetGet($offset)
{
return $this->$offset;
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
@ -173,7 +179,11 @@ class Animal implements ArrayAccess
*/
public function offsetSet($offset, $value)
{
$this->$offset = $value;
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
@ -183,7 +193,7 @@ class Animal implements ArrayAccess
*/
public function offsetUnset($offset)
{
unset($this->$offset);
unset($this->container[$offset]);
}
/**

View File

@ -0,0 +1,182 @@
<?php
/**
* AnimalFarm
*
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Copyright 2016 SmartBear Software
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace Swagger\Client\Model;
use \ArrayAccess;
/**
* AnimalFarm Class Doc Comment
*
* @category Class
* @description
* @package Swagger\Client
* @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
* @link https://github.com/swagger-api/swagger-codegen
*/
class AnimalFarm implements ArrayAccess
{
/**
* The original name of the model.
* @var string
*/
static $swaggerModelName = 'AnimalFarm';
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
*/
static $swaggerTypes = array(
);
static function swaggerTypes() {
return self::$swaggerTypes;
}
/**
* Array of attributes where the key is the local name, and the value is the original name
* @var string[]
*/
static $attributeMap = array(
);
static function attributeMap() {
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
* @var string[]
*/
static $setters = array(
);
static function setters() {
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
* @var string[]
*/
static $getters = array(
);
static function getters() {
return self::$getters;
}
/**
* Associative array for storing property values
* @var mixed[]
*/
protected $container = array();
/**
* Constructor
* @param mixed[] $data Associated array of property value initalizing the model
*/
public function __construct(array $data = null)
{
if ($data != null) {
}
}
/**
* Returns true if offset exists. False otherwise.
* @param integer $offset Offset
* @return boolean
*/
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
* @param integer $offset Offset
* @return mixed
*/
public function offsetGet($offset)
{
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
* Sets value based on offset.
* @param integer $offset Offset
* @param mixed $value Value to be set
* @return void
*/
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
* @param integer $offset Offset
* @return void
*/
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
}
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
}
}

View File

@ -113,20 +113,28 @@ class ApiResponse implements ArrayAccess
/**
* $code
* @var int
* Associative array for storing property values
* @var mixed[]
*/
protected $code;
/**
* $type
* @var string
*/
protected $type;
/**
* $message
* @var string
*/
protected $message;
protected $container = array(
/**
* $container['code']
* @var int
*/
'code' => null,
/**
* $container['type']
* @var string
*/
'type' => null,
/**
* $container['message']
* @var string
*/
'message' => null,
);
/**
* Constructor
@ -137,9 +145,9 @@ class ApiResponse implements ArrayAccess
if ($data != null) {
$this->code = $data["code"];
$this->type = $data["type"];
$this->message = $data["message"];
$this->container['code'] = $data['code'];
$this->container['type'] = $data['type'];
$this->container['message'] = $data['message'];
}
}
/**
@ -148,7 +156,7 @@ class ApiResponse implements ArrayAccess
*/
public function getCode()
{
return $this->code;
return $this->container['code'];
}
/**
@ -159,7 +167,7 @@ class ApiResponse implements ArrayAccess
public function setCode($code)
{
$this->code = $code;
$this->container['code'] = $code;
return $this;
}
/**
@ -168,7 +176,7 @@ class ApiResponse implements ArrayAccess
*/
public function getType()
{
return $this->type;
return $this->container['type'];
}
/**
@ -179,7 +187,7 @@ class ApiResponse implements ArrayAccess
public function setType($type)
{
$this->type = $type;
$this->container['type'] = $type;
return $this;
}
/**
@ -188,7 +196,7 @@ class ApiResponse implements ArrayAccess
*/
public function getMessage()
{
return $this->message;
return $this->container['message'];
}
/**
@ -199,7 +207,7 @@ class ApiResponse implements ArrayAccess
public function setMessage($message)
{
$this->message = $message;
$this->container['message'] = $message;
return $this;
}
/**
@ -209,7 +217,7 @@ class ApiResponse implements ArrayAccess
*/
public function offsetExists($offset)
{
return isset($this->$offset);
return isset($this->container[$offset]);
}
/**
@ -219,7 +227,7 @@ class ApiResponse implements ArrayAccess
*/
public function offsetGet($offset)
{
return $this->$offset;
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
@ -230,7 +238,11 @@ class ApiResponse implements ArrayAccess
*/
public function offsetSet($offset, $value)
{
$this->$offset = $value;
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
@ -240,7 +252,7 @@ class ApiResponse implements ArrayAccess
*/
public function offsetUnset($offset)
{
unset($this->$offset);
unset($this->container[$offset]);
}
/**

View File

@ -105,10 +105,16 @@ class Cat extends Animal implements ArrayAccess
/**
* $declawed
* @var bool
* Associative array for storing property values
* @var mixed[]
*/
protected $declawed;
protected $container = array(
/**
* $container['declawed']
* @var bool
*/
'declawed' => null,
);
/**
* Constructor
@ -119,7 +125,7 @@ class Cat extends Animal implements ArrayAccess
parent::__construct($data);
if ($data != null) {
$this->declawed = $data["declawed"];
$this->container['declawed'] = $data['declawed'];
}
}
/**
@ -128,7 +134,7 @@ class Cat extends Animal implements ArrayAccess
*/
public function getDeclawed()
{
return $this->declawed;
return $this->container['declawed'];
}
/**
@ -139,7 +145,7 @@ class Cat extends Animal implements ArrayAccess
public function setDeclawed($declawed)
{
$this->declawed = $declawed;
$this->container['declawed'] = $declawed;
return $this;
}
/**
@ -149,7 +155,7 @@ class Cat extends Animal implements ArrayAccess
*/
public function offsetExists($offset)
{
return isset($this->$offset);
return isset($this->container[$offset]);
}
/**
@ -159,7 +165,7 @@ class Cat extends Animal implements ArrayAccess
*/
public function offsetGet($offset)
{
return $this->$offset;
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
@ -170,7 +176,11 @@ class Cat extends Animal implements ArrayAccess
*/
public function offsetSet($offset, $value)
{
$this->$offset = $value;
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
@ -180,7 +190,7 @@ class Cat extends Animal implements ArrayAccess
*/
public function offsetUnset($offset)
{
unset($this->$offset);
unset($this->container[$offset]);
}
/**

View File

@ -109,15 +109,22 @@ class Category implements ArrayAccess
/**
* $id
* @var int
* Associative array for storing property values
* @var mixed[]
*/
protected $id;
/**
* $name
* @var string
*/
protected $name;
protected $container = array(
/**
* $container['id']
* @var int
*/
'id' => null,
/**
* $container['name']
* @var string
*/
'name' => null,
);
/**
* Constructor
@ -128,8 +135,8 @@ class Category implements ArrayAccess
if ($data != null) {
$this->id = $data["id"];
$this->name = $data["name"];
$this->container['id'] = $data['id'];
$this->container['name'] = $data['name'];
}
}
/**
@ -138,7 +145,7 @@ class Category implements ArrayAccess
*/
public function getId()
{
return $this->id;
return $this->container['id'];
}
/**
@ -149,7 +156,7 @@ class Category implements ArrayAccess
public function setId($id)
{
$this->id = $id;
$this->container['id'] = $id;
return $this;
}
/**
@ -158,7 +165,7 @@ class Category implements ArrayAccess
*/
public function getName()
{
return $this->name;
return $this->container['name'];
}
/**
@ -169,7 +176,7 @@ class Category implements ArrayAccess
public function setName($name)
{
$this->name = $name;
$this->container['name'] = $name;
return $this;
}
/**
@ -179,7 +186,7 @@ class Category implements ArrayAccess
*/
public function offsetExists($offset)
{
return isset($this->$offset);
return isset($this->container[$offset]);
}
/**
@ -189,7 +196,7 @@ class Category implements ArrayAccess
*/
public function offsetGet($offset)
{
return $this->$offset;
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
@ -200,7 +207,11 @@ class Category implements ArrayAccess
*/
public function offsetSet($offset, $value)
{
$this->$offset = $value;
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
@ -210,7 +221,7 @@ class Category implements ArrayAccess
*/
public function offsetUnset($offset)
{
unset($this->$offset);
unset($this->container[$offset]);
}
/**

View File

@ -105,10 +105,16 @@ class Dog extends Animal implements ArrayAccess
/**
* $breed
* @var string
* Associative array for storing property values
* @var mixed[]
*/
protected $breed;
protected $container = array(
/**
* $container['breed']
* @var string
*/
'breed' => null,
);
/**
* Constructor
@ -119,7 +125,7 @@ class Dog extends Animal implements ArrayAccess
parent::__construct($data);
if ($data != null) {
$this->breed = $data["breed"];
$this->container['breed'] = $data['breed'];
}
}
/**
@ -128,7 +134,7 @@ class Dog extends Animal implements ArrayAccess
*/
public function getBreed()
{
return $this->breed;
return $this->container['breed'];
}
/**
@ -139,7 +145,7 @@ class Dog extends Animal implements ArrayAccess
public function setBreed($breed)
{
$this->breed = $breed;
$this->container['breed'] = $breed;
return $this;
}
/**
@ -149,7 +155,7 @@ class Dog extends Animal implements ArrayAccess
*/
public function offsetExists($offset)
{
return isset($this->$offset);
return isset($this->container[$offset]);
}
/**
@ -159,7 +165,7 @@ class Dog extends Animal implements ArrayAccess
*/
public function offsetGet($offset)
{
return $this->$offset;
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
@ -170,7 +176,11 @@ class Dog extends Animal implements ArrayAccess
*/
public function offsetSet($offset, $value)
{
$this->$offset = $value;
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
@ -180,7 +190,7 @@ class Dog extends Animal implements ArrayAccess
*/
public function offsetUnset($offset)
{
unset($this->$offset);
unset($this->container[$offset]);
}
/**

View File

@ -68,6 +68,7 @@ class FormatTest implements ArrayAccess
'binary' => 'string',
'date' => '\DateTime',
'date_time' => '\DateTime',
'uuid' => 'string',
'password' => 'string'
);
@ -91,6 +92,7 @@ class FormatTest implements ArrayAccess
'binary' => 'binary',
'date' => 'date',
'date_time' => 'dateTime',
'uuid' => 'uuid',
'password' => 'password'
);
@ -114,6 +116,7 @@ class FormatTest implements ArrayAccess
'binary' => 'setBinary',
'date' => 'setDate',
'date_time' => 'setDateTime',
'uuid' => 'setUuid',
'password' => 'setPassword'
);
@ -137,6 +140,7 @@ class FormatTest implements ArrayAccess
'binary' => 'getBinary',
'date' => 'getDate',
'date_time' => 'getDateTime',
'uuid' => 'getUuid',
'password' => 'getPassword'
);
@ -149,65 +153,88 @@ class FormatTest implements ArrayAccess
/**
* $integer
* @var int
* Associative array for storing property values
* @var mixed[]
*/
protected $integer;
/**
* $int32
* @var int
*/
protected $int32;
/**
* $int64
* @var int
*/
protected $int64;
/**
* $number
* @var float
*/
protected $number;
/**
* $float
* @var float
*/
protected $float;
/**
* $double
* @var double
*/
protected $double;
/**
* $string
* @var string
*/
protected $string;
/**
* $byte
* @var string
*/
protected $byte;
/**
* $binary
* @var string
*/
protected $binary;
/**
* $date
* @var \DateTime
*/
protected $date;
/**
* $date_time
* @var \DateTime
*/
protected $date_time;
/**
* $password
* @var string
*/
protected $password;
protected $container = array(
/**
* $container['integer']
* @var int
*/
'integer' => null,
/**
* $container['int32']
* @var int
*/
'int32' => null,
/**
* $container['int64']
* @var int
*/
'int64' => null,
/**
* $container['number']
* @var float
*/
'number' => null,
/**
* $container['float']
* @var float
*/
'float' => null,
/**
* $container['double']
* @var double
*/
'double' => null,
/**
* $container['string']
* @var string
*/
'string' => null,
/**
* $container['byte']
* @var string
*/
'byte' => null,
/**
* $container['binary']
* @var string
*/
'binary' => null,
/**
* $container['date']
* @var \DateTime
*/
'date' => null,
/**
* $container['date_time']
* @var \DateTime
*/
'date_time' => null,
/**
* $container['uuid']
* @var string
*/
'uuid' => null,
/**
* $container['password']
* @var string
*/
'password' => null,
);
/**
* Constructor
@ -218,18 +245,19 @@ class FormatTest implements ArrayAccess
if ($data != null) {
$this->integer = $data["integer"];
$this->int32 = $data["int32"];
$this->int64 = $data["int64"];
$this->number = $data["number"];
$this->float = $data["float"];
$this->double = $data["double"];
$this->string = $data["string"];
$this->byte = $data["byte"];
$this->binary = $data["binary"];
$this->date = $data["date"];
$this->date_time = $data["date_time"];
$this->password = $data["password"];
$this->container['integer'] = $data['integer'];
$this->container['int32'] = $data['int32'];
$this->container['int64'] = $data['int64'];
$this->container['number'] = $data['number'];
$this->container['float'] = $data['float'];
$this->container['double'] = $data['double'];
$this->container['string'] = $data['string'];
$this->container['byte'] = $data['byte'];
$this->container['binary'] = $data['binary'];
$this->container['date'] = $data['date'];
$this->container['date_time'] = $data['date_time'];
$this->container['uuid'] = $data['uuid'];
$this->container['password'] = $data['password'];
}
}
/**
@ -238,7 +266,7 @@ class FormatTest implements ArrayAccess
*/
public function getInteger()
{
return $this->integer;
return $this->container['integer'];
}
/**
@ -249,7 +277,7 @@ class FormatTest implements ArrayAccess
public function setInteger($integer)
{
$this->integer = $integer;
$this->container['integer'] = $integer;
return $this;
}
/**
@ -258,7 +286,7 @@ class FormatTest implements ArrayAccess
*/
public function getInt32()
{
return $this->int32;
return $this->container['int32'];
}
/**
@ -269,7 +297,7 @@ class FormatTest implements ArrayAccess
public function setInt32($int32)
{
$this->int32 = $int32;
$this->container['int32'] = $int32;
return $this;
}
/**
@ -278,7 +306,7 @@ class FormatTest implements ArrayAccess
*/
public function getInt64()
{
return $this->int64;
return $this->container['int64'];
}
/**
@ -289,7 +317,7 @@ class FormatTest implements ArrayAccess
public function setInt64($int64)
{
$this->int64 = $int64;
$this->container['int64'] = $int64;
return $this;
}
/**
@ -298,7 +326,7 @@ class FormatTest implements ArrayAccess
*/
public function getNumber()
{
return $this->number;
return $this->container['number'];
}
/**
@ -309,7 +337,7 @@ class FormatTest implements ArrayAccess
public function setNumber($number)
{
$this->number = $number;
$this->container['number'] = $number;
return $this;
}
/**
@ -318,7 +346,7 @@ class FormatTest implements ArrayAccess
*/
public function getFloat()
{
return $this->float;
return $this->container['float'];
}
/**
@ -329,7 +357,7 @@ class FormatTest implements ArrayAccess
public function setFloat($float)
{
$this->float = $float;
$this->container['float'] = $float;
return $this;
}
/**
@ -338,7 +366,7 @@ class FormatTest implements ArrayAccess
*/
public function getDouble()
{
return $this->double;
return $this->container['double'];
}
/**
@ -349,7 +377,7 @@ class FormatTest implements ArrayAccess
public function setDouble($double)
{
$this->double = $double;
$this->container['double'] = $double;
return $this;
}
/**
@ -358,7 +386,7 @@ class FormatTest implements ArrayAccess
*/
public function getString()
{
return $this->string;
return $this->container['string'];
}
/**
@ -369,7 +397,7 @@ class FormatTest implements ArrayAccess
public function setString($string)
{
$this->string = $string;
$this->container['string'] = $string;
return $this;
}
/**
@ -378,7 +406,7 @@ class FormatTest implements ArrayAccess
*/
public function getByte()
{
return $this->byte;
return $this->container['byte'];
}
/**
@ -389,7 +417,7 @@ class FormatTest implements ArrayAccess
public function setByte($byte)
{
$this->byte = $byte;
$this->container['byte'] = $byte;
return $this;
}
/**
@ -398,7 +426,7 @@ class FormatTest implements ArrayAccess
*/
public function getBinary()
{
return $this->binary;
return $this->container['binary'];
}
/**
@ -409,7 +437,7 @@ class FormatTest implements ArrayAccess
public function setBinary($binary)
{
$this->binary = $binary;
$this->container['binary'] = $binary;
return $this;
}
/**
@ -418,7 +446,7 @@ class FormatTest implements ArrayAccess
*/
public function getDate()
{
return $this->date;
return $this->container['date'];
}
/**
@ -429,7 +457,7 @@ class FormatTest implements ArrayAccess
public function setDate($date)
{
$this->date = $date;
$this->container['date'] = $date;
return $this;
}
/**
@ -438,7 +466,7 @@ class FormatTest implements ArrayAccess
*/
public function getDateTime()
{
return $this->date_time;
return $this->container['date_time'];
}
/**
@ -449,7 +477,27 @@ class FormatTest implements ArrayAccess
public function setDateTime($date_time)
{
$this->date_time = $date_time;
$this->container['date_time'] = $date_time;
return $this;
}
/**
* Gets uuid
* @return string
*/
public function getUuid()
{
return $this->container['uuid'];
}
/**
* Sets uuid
* @param string $uuid
* @return $this
*/
public function setUuid($uuid)
{
$this->container['uuid'] = $uuid;
return $this;
}
/**
@ -458,7 +506,7 @@ class FormatTest implements ArrayAccess
*/
public function getPassword()
{
return $this->password;
return $this->container['password'];
}
/**
@ -469,7 +517,7 @@ class FormatTest implements ArrayAccess
public function setPassword($password)
{
$this->password = $password;
$this->container['password'] = $password;
return $this;
}
/**
@ -479,7 +527,7 @@ class FormatTest implements ArrayAccess
*/
public function offsetExists($offset)
{
return isset($this->$offset);
return isset($this->container[$offset]);
}
/**
@ -489,7 +537,7 @@ class FormatTest implements ArrayAccess
*/
public function offsetGet($offset)
{
return $this->$offset;
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
@ -500,7 +548,11 @@ class FormatTest implements ArrayAccess
*/
public function offsetSet($offset, $value)
{
$this->$offset = $value;
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
@ -510,7 +562,7 @@ class FormatTest implements ArrayAccess
*/
public function offsetUnset($offset)
{
unset($this->$offset);
unset($this->container[$offset]);
}
/**

View File

@ -105,10 +105,16 @@ class Model200Response implements ArrayAccess
/**
* $name
* @var int
* Associative array for storing property values
* @var mixed[]
*/
protected $name;
protected $container = array(
/**
* $container['name']
* @var int
*/
'name' => null,
);
/**
* Constructor
@ -119,7 +125,7 @@ class Model200Response implements ArrayAccess
if ($data != null) {
$this->name = $data["name"];
$this->container['name'] = $data['name'];
}
}
/**
@ -128,7 +134,7 @@ class Model200Response implements ArrayAccess
*/
public function getName()
{
return $this->name;
return $this->container['name'];
}
/**
@ -139,7 +145,7 @@ class Model200Response implements ArrayAccess
public function setName($name)
{
$this->name = $name;
$this->container['name'] = $name;
return $this;
}
/**
@ -149,7 +155,7 @@ class Model200Response implements ArrayAccess
*/
public function offsetExists($offset)
{
return isset($this->$offset);
return isset($this->container[$offset]);
}
/**
@ -159,7 +165,7 @@ class Model200Response implements ArrayAccess
*/
public function offsetGet($offset)
{
return $this->$offset;
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
@ -170,7 +176,11 @@ class Model200Response implements ArrayAccess
*/
public function offsetSet($offset, $value)
{
$this->$offset = $value;
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
@ -180,7 +190,7 @@ class Model200Response implements ArrayAccess
*/
public function offsetUnset($offset)
{
unset($this->$offset);
unset($this->container[$offset]);
}
/**

View File

@ -105,10 +105,16 @@ class ModelReturn implements ArrayAccess
/**
* $return
* @var int
* Associative array for storing property values
* @var mixed[]
*/
protected $return;
protected $container = array(
/**
* $container['return']
* @var int
*/
'return' => null,
);
/**
* Constructor
@ -119,7 +125,7 @@ class ModelReturn implements ArrayAccess
if ($data != null) {
$this->return = $data["return"];
$this->container['return'] = $data['return'];
}
}
/**
@ -128,7 +134,7 @@ class ModelReturn implements ArrayAccess
*/
public function getReturn()
{
return $this->return;
return $this->container['return'];
}
/**
@ -139,7 +145,7 @@ class ModelReturn implements ArrayAccess
public function setReturn($return)
{
$this->return = $return;
$this->container['return'] = $return;
return $this;
}
/**
@ -149,7 +155,7 @@ class ModelReturn implements ArrayAccess
*/
public function offsetExists($offset)
{
return isset($this->$offset);
return isset($this->container[$offset]);
}
/**
@ -159,7 +165,7 @@ class ModelReturn implements ArrayAccess
*/
public function offsetGet($offset)
{
return $this->$offset;
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
@ -170,7 +176,11 @@ class ModelReturn implements ArrayAccess
*/
public function offsetSet($offset, $value)
{
$this->$offset = $value;
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
@ -180,7 +190,7 @@ class ModelReturn implements ArrayAccess
*/
public function offsetUnset($offset)
{
unset($this->$offset);
unset($this->container[$offset]);
}
/**

View File

@ -113,20 +113,28 @@ class Name implements ArrayAccess
/**
* $name
* @var int
* Associative array for storing property values
* @var mixed[]
*/
protected $name;
/**
* $snake_case
* @var int
*/
protected $snake_case;
/**
* $property
* @var string
*/
protected $property;
protected $container = array(
/**
* $container['name']
* @var int
*/
'name' => null,
/**
* $container['snake_case']
* @var int
*/
'snake_case' => null,
/**
* $container['property']
* @var string
*/
'property' => null,
);
/**
* Constructor
@ -137,9 +145,9 @@ class Name implements ArrayAccess
if ($data != null) {
$this->name = $data["name"];
$this->snake_case = $data["snake_case"];
$this->property = $data["property"];
$this->container['name'] = $data['name'];
$this->container['snake_case'] = $data['snake_case'];
$this->container['property'] = $data['property'];
}
}
/**
@ -148,7 +156,7 @@ class Name implements ArrayAccess
*/
public function getName()
{
return $this->name;
return $this->container['name'];
}
/**
@ -159,7 +167,7 @@ class Name implements ArrayAccess
public function setName($name)
{
$this->name = $name;
$this->container['name'] = $name;
return $this;
}
/**
@ -168,7 +176,7 @@ class Name implements ArrayAccess
*/
public function getSnakeCase()
{
return $this->snake_case;
return $this->container['snake_case'];
}
/**
@ -179,7 +187,7 @@ class Name implements ArrayAccess
public function setSnakeCase($snake_case)
{
$this->snake_case = $snake_case;
$this->container['snake_case'] = $snake_case;
return $this;
}
/**
@ -188,7 +196,7 @@ class Name implements ArrayAccess
*/
public function getProperty()
{
return $this->property;
return $this->container['property'];
}
/**
@ -199,7 +207,7 @@ class Name implements ArrayAccess
public function setProperty($property)
{
$this->property = $property;
$this->container['property'] = $property;
return $this;
}
/**
@ -209,7 +217,7 @@ class Name implements ArrayAccess
*/
public function offsetExists($offset)
{
return isset($this->$offset);
return isset($this->container[$offset]);
}
/**
@ -219,7 +227,7 @@ class Name implements ArrayAccess
*/
public function offsetGet($offset)
{
return $this->$offset;
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
@ -230,7 +238,11 @@ class Name implements ArrayAccess
*/
public function offsetSet($offset, $value)
{
$this->$offset = $value;
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
@ -240,7 +252,7 @@ class Name implements ArrayAccess
*/
public function offsetUnset($offset)
{
unset($this->$offset);
unset($this->container[$offset]);
}
/**

View File

@ -140,35 +140,46 @@ class Order implements ArrayAccess
/**
* $id
* @var int
* Associative array for storing property values
* @var mixed[]
*/
protected $id;
/**
* $pet_id
* @var int
*/
protected $pet_id;
/**
* $quantity
* @var int
*/
protected $quantity;
/**
* $ship_date
* @var \DateTime
*/
protected $ship_date;
/**
* $status Order Status
* @var string
*/
protected $status;
/**
* $complete
* @var bool
*/
protected $complete = false;
protected $container = array(
/**
* $container['id']
* @var int
*/
'id' => null,
/**
* $container['pet_id']
* @var int
*/
'pet_id' => null,
/**
* $container['quantity']
* @var int
*/
'quantity' => null,
/**
* $container['ship_date']
* @var \DateTime
*/
'ship_date' => null,
/**
* $container['status'] Order Status
* @var string
*/
'status' => null,
/**
* $container['complete']
* @var bool
*/
'complete' => false,
);
/**
* Constructor
@ -179,12 +190,12 @@ class Order implements ArrayAccess
if ($data != null) {
$this->id = $data["id"];
$this->pet_id = $data["pet_id"];
$this->quantity = $data["quantity"];
$this->ship_date = $data["ship_date"];
$this->status = $data["status"];
$this->complete = $data["complete"];
$this->container['id'] = $data['id'];
$this->container['pet_id'] = $data['pet_id'];
$this->container['quantity'] = $data['quantity'];
$this->container['ship_date'] = $data['ship_date'];
$this->container['status'] = $data['status'];
$this->container['complete'] = $data['complete'];
}
}
/**
@ -193,7 +204,7 @@ class Order implements ArrayAccess
*/
public function getId()
{
return $this->id;
return $this->container['id'];
}
/**
@ -204,7 +215,7 @@ class Order implements ArrayAccess
public function setId($id)
{
$this->id = $id;
$this->container['id'] = $id;
return $this;
}
/**
@ -213,7 +224,7 @@ class Order implements ArrayAccess
*/
public function getPetId()
{
return $this->pet_id;
return $this->container['pet_id'];
}
/**
@ -224,7 +235,7 @@ class Order implements ArrayAccess
public function setPetId($pet_id)
{
$this->pet_id = $pet_id;
$this->container['pet_id'] = $pet_id;
return $this;
}
/**
@ -233,7 +244,7 @@ class Order implements ArrayAccess
*/
public function getQuantity()
{
return $this->quantity;
return $this->container['quantity'];
}
/**
@ -244,7 +255,7 @@ class Order implements ArrayAccess
public function setQuantity($quantity)
{
$this->quantity = $quantity;
$this->container['quantity'] = $quantity;
return $this;
}
/**
@ -253,7 +264,7 @@ class Order implements ArrayAccess
*/
public function getShipDate()
{
return $this->ship_date;
return $this->container['ship_date'];
}
/**
@ -264,7 +275,7 @@ class Order implements ArrayAccess
public function setShipDate($ship_date)
{
$this->ship_date = $ship_date;
$this->container['ship_date'] = $ship_date;
return $this;
}
/**
@ -273,7 +284,7 @@ class Order implements ArrayAccess
*/
public function getStatus()
{
return $this->status;
return $this->container['status'];
}
/**
@ -283,11 +294,11 @@ class Order implements ArrayAccess
*/
public function setStatus($status)
{
$allowed_values = array("placed", "approved", "delivered");
$allowed_values = array('placed', 'approved', 'delivered');
if (!in_array($status, $allowed_values)) {
throw new \InvalidArgumentException("Invalid value for 'status', must be one of 'placed', 'approved', 'delivered'");
}
$this->status = $status;
$this->container['status'] = $status;
return $this;
}
/**
@ -296,7 +307,7 @@ class Order implements ArrayAccess
*/
public function getComplete()
{
return $this->complete;
return $this->container['complete'];
}
/**
@ -307,7 +318,7 @@ class Order implements ArrayAccess
public function setComplete($complete)
{
$this->complete = $complete;
$this->container['complete'] = $complete;
return $this;
}
/**
@ -317,7 +328,7 @@ class Order implements ArrayAccess
*/
public function offsetExists($offset)
{
return isset($this->$offset);
return isset($this->container[$offset]);
}
/**
@ -327,7 +338,7 @@ class Order implements ArrayAccess
*/
public function offsetGet($offset)
{
return $this->$offset;
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
@ -338,7 +349,11 @@ class Order implements ArrayAccess
*/
public function offsetSet($offset, $value)
{
$this->$offset = $value;
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
@ -348,7 +363,7 @@ class Order implements ArrayAccess
*/
public function offsetUnset($offset)
{
unset($this->$offset);
unset($this->container[$offset]);
}
/**

View File

@ -140,35 +140,46 @@ class Pet implements ArrayAccess
/**
* $id
* @var int
* Associative array for storing property values
* @var mixed[]
*/
protected $id;
/**
* $category
* @var \Swagger\Client\Model\Category
*/
protected $category;
/**
* $name
* @var string
*/
protected $name;
/**
* $photo_urls
* @var string[]
*/
protected $photo_urls;
/**
* $tags
* @var \Swagger\Client\Model\Tag[]
*/
protected $tags;
/**
* $status pet status in the store
* @var string
*/
protected $status;
protected $container = array(
/**
* $container['id']
* @var int
*/
'id' => null,
/**
* $container['category']
* @var \Swagger\Client\Model\Category
*/
'category' => null,
/**
* $container['name']
* @var string
*/
'name' => null,
/**
* $container['photo_urls']
* @var string[]
*/
'photo_urls' => null,
/**
* $container['tags']
* @var \Swagger\Client\Model\Tag[]
*/
'tags' => null,
/**
* $container['status'] pet status in the store
* @var string
*/
'status' => null,
);
/**
* Constructor
@ -179,12 +190,12 @@ class Pet implements ArrayAccess
if ($data != null) {
$this->id = $data["id"];
$this->category = $data["category"];
$this->name = $data["name"];
$this->photo_urls = $data["photo_urls"];
$this->tags = $data["tags"];
$this->status = $data["status"];
$this->container['id'] = $data['id'];
$this->container['category'] = $data['category'];
$this->container['name'] = $data['name'];
$this->container['photo_urls'] = $data['photo_urls'];
$this->container['tags'] = $data['tags'];
$this->container['status'] = $data['status'];
}
}
/**
@ -193,7 +204,7 @@ class Pet implements ArrayAccess
*/
public function getId()
{
return $this->id;
return $this->container['id'];
}
/**
@ -204,7 +215,7 @@ class Pet implements ArrayAccess
public function setId($id)
{
$this->id = $id;
$this->container['id'] = $id;
return $this;
}
/**
@ -213,7 +224,7 @@ class Pet implements ArrayAccess
*/
public function getCategory()
{
return $this->category;
return $this->container['category'];
}
/**
@ -224,7 +235,7 @@ class Pet implements ArrayAccess
public function setCategory($category)
{
$this->category = $category;
$this->container['category'] = $category;
return $this;
}
/**
@ -233,7 +244,7 @@ class Pet implements ArrayAccess
*/
public function getName()
{
return $this->name;
return $this->container['name'];
}
/**
@ -244,7 +255,7 @@ class Pet implements ArrayAccess
public function setName($name)
{
$this->name = $name;
$this->container['name'] = $name;
return $this;
}
/**
@ -253,7 +264,7 @@ class Pet implements ArrayAccess
*/
public function getPhotoUrls()
{
return $this->photo_urls;
return $this->container['photo_urls'];
}
/**
@ -264,7 +275,7 @@ class Pet implements ArrayAccess
public function setPhotoUrls($photo_urls)
{
$this->photo_urls = $photo_urls;
$this->container['photo_urls'] = $photo_urls;
return $this;
}
/**
@ -273,7 +284,7 @@ class Pet implements ArrayAccess
*/
public function getTags()
{
return $this->tags;
return $this->container['tags'];
}
/**
@ -284,7 +295,7 @@ class Pet implements ArrayAccess
public function setTags($tags)
{
$this->tags = $tags;
$this->container['tags'] = $tags;
return $this;
}
/**
@ -293,7 +304,7 @@ class Pet implements ArrayAccess
*/
public function getStatus()
{
return $this->status;
return $this->container['status'];
}
/**
@ -303,11 +314,11 @@ class Pet implements ArrayAccess
*/
public function setStatus($status)
{
$allowed_values = array("available", "pending", "sold");
$allowed_values = array('available', 'pending', 'sold');
if (!in_array($status, $allowed_values)) {
throw new \InvalidArgumentException("Invalid value for 'status', must be one of 'available', 'pending', 'sold'");
}
$this->status = $status;
$this->container['status'] = $status;
return $this;
}
/**
@ -317,7 +328,7 @@ class Pet implements ArrayAccess
*/
public function offsetExists($offset)
{
return isset($this->$offset);
return isset($this->container[$offset]);
}
/**
@ -327,7 +338,7 @@ class Pet implements ArrayAccess
*/
public function offsetGet($offset)
{
return $this->$offset;
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
@ -338,7 +349,11 @@ class Pet implements ArrayAccess
*/
public function offsetSet($offset, $value)
{
$this->$offset = $value;
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
@ -348,7 +363,7 @@ class Pet implements ArrayAccess
*/
public function offsetUnset($offset)
{
unset($this->$offset);
unset($this->container[$offset]);
}
/**

View File

@ -105,10 +105,16 @@ class SpecialModelName implements ArrayAccess
/**
* $special_property_name
* @var int
* Associative array for storing property values
* @var mixed[]
*/
protected $special_property_name;
protected $container = array(
/**
* $container['special_property_name']
* @var int
*/
'special_property_name' => null,
);
/**
* Constructor
@ -119,7 +125,7 @@ class SpecialModelName implements ArrayAccess
if ($data != null) {
$this->special_property_name = $data["special_property_name"];
$this->container['special_property_name'] = $data['special_property_name'];
}
}
/**
@ -128,7 +134,7 @@ class SpecialModelName implements ArrayAccess
*/
public function getSpecialPropertyName()
{
return $this->special_property_name;
return $this->container['special_property_name'];
}
/**
@ -139,7 +145,7 @@ class SpecialModelName implements ArrayAccess
public function setSpecialPropertyName($special_property_name)
{
$this->special_property_name = $special_property_name;
$this->container['special_property_name'] = $special_property_name;
return $this;
}
/**
@ -149,7 +155,7 @@ class SpecialModelName implements ArrayAccess
*/
public function offsetExists($offset)
{
return isset($this->$offset);
return isset($this->container[$offset]);
}
/**
@ -159,7 +165,7 @@ class SpecialModelName implements ArrayAccess
*/
public function offsetGet($offset)
{
return $this->$offset;
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
@ -170,7 +176,11 @@ class SpecialModelName implements ArrayAccess
*/
public function offsetSet($offset, $value)
{
$this->$offset = $value;
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
@ -180,7 +190,7 @@ class SpecialModelName implements ArrayAccess
*/
public function offsetUnset($offset)
{
unset($this->$offset);
unset($this->container[$offset]);
}
/**

View File

@ -109,15 +109,22 @@ class Tag implements ArrayAccess
/**
* $id
* @var int
* Associative array for storing property values
* @var mixed[]
*/
protected $id;
/**
* $name
* @var string
*/
protected $name;
protected $container = array(
/**
* $container['id']
* @var int
*/
'id' => null,
/**
* $container['name']
* @var string
*/
'name' => null,
);
/**
* Constructor
@ -128,8 +135,8 @@ class Tag implements ArrayAccess
if ($data != null) {
$this->id = $data["id"];
$this->name = $data["name"];
$this->container['id'] = $data['id'];
$this->container['name'] = $data['name'];
}
}
/**
@ -138,7 +145,7 @@ class Tag implements ArrayAccess
*/
public function getId()
{
return $this->id;
return $this->container['id'];
}
/**
@ -149,7 +156,7 @@ class Tag implements ArrayAccess
public function setId($id)
{
$this->id = $id;
$this->container['id'] = $id;
return $this;
}
/**
@ -158,7 +165,7 @@ class Tag implements ArrayAccess
*/
public function getName()
{
return $this->name;
return $this->container['name'];
}
/**
@ -169,7 +176,7 @@ class Tag implements ArrayAccess
public function setName($name)
{
$this->name = $name;
$this->container['name'] = $name;
return $this;
}
/**
@ -179,7 +186,7 @@ class Tag implements ArrayAccess
*/
public function offsetExists($offset)
{
return isset($this->$offset);
return isset($this->container[$offset]);
}
/**
@ -189,7 +196,7 @@ class Tag implements ArrayAccess
*/
public function offsetGet($offset)
{
return $this->$offset;
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
@ -200,7 +207,11 @@ class Tag implements ArrayAccess
*/
public function offsetSet($offset, $value)
{
$this->$offset = $value;
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
@ -210,7 +221,7 @@ class Tag implements ArrayAccess
*/
public function offsetUnset($offset)
{
unset($this->$offset);
unset($this->container[$offset]);
}
/**

View File

@ -133,45 +133,58 @@ class User implements ArrayAccess
/**
* $id
* @var int
* Associative array for storing property values
* @var mixed[]
*/
protected $id;
/**
* $username
* @var string
*/
protected $username;
/**
* $first_name
* @var string
*/
protected $first_name;
/**
* $last_name
* @var string
*/
protected $last_name;
/**
* $email
* @var string
*/
protected $email;
/**
* $password
* @var string
*/
protected $password;
/**
* $phone
* @var string
*/
protected $phone;
/**
* $user_status User Status
* @var int
*/
protected $user_status;
protected $container = array(
/**
* $container['id']
* @var int
*/
'id' => null,
/**
* $container['username']
* @var string
*/
'username' => null,
/**
* $container['first_name']
* @var string
*/
'first_name' => null,
/**
* $container['last_name']
* @var string
*/
'last_name' => null,
/**
* $container['email']
* @var string
*/
'email' => null,
/**
* $container['password']
* @var string
*/
'password' => null,
/**
* $container['phone']
* @var string
*/
'phone' => null,
/**
* $container['user_status'] User Status
* @var int
*/
'user_status' => null,
);
/**
* Constructor
@ -182,14 +195,14 @@ class User implements ArrayAccess
if ($data != null) {
$this->id = $data["id"];
$this->username = $data["username"];
$this->first_name = $data["first_name"];
$this->last_name = $data["last_name"];
$this->email = $data["email"];
$this->password = $data["password"];
$this->phone = $data["phone"];
$this->user_status = $data["user_status"];
$this->container['id'] = $data['id'];
$this->container['username'] = $data['username'];
$this->container['first_name'] = $data['first_name'];
$this->container['last_name'] = $data['last_name'];
$this->container['email'] = $data['email'];
$this->container['password'] = $data['password'];
$this->container['phone'] = $data['phone'];
$this->container['user_status'] = $data['user_status'];
}
}
/**
@ -198,7 +211,7 @@ class User implements ArrayAccess
*/
public function getId()
{
return $this->id;
return $this->container['id'];
}
/**
@ -209,7 +222,7 @@ class User implements ArrayAccess
public function setId($id)
{
$this->id = $id;
$this->container['id'] = $id;
return $this;
}
/**
@ -218,7 +231,7 @@ class User implements ArrayAccess
*/
public function getUsername()
{
return $this->username;
return $this->container['username'];
}
/**
@ -229,7 +242,7 @@ class User implements ArrayAccess
public function setUsername($username)
{
$this->username = $username;
$this->container['username'] = $username;
return $this;
}
/**
@ -238,7 +251,7 @@ class User implements ArrayAccess
*/
public function getFirstName()
{
return $this->first_name;
return $this->container['first_name'];
}
/**
@ -249,7 +262,7 @@ class User implements ArrayAccess
public function setFirstName($first_name)
{
$this->first_name = $first_name;
$this->container['first_name'] = $first_name;
return $this;
}
/**
@ -258,7 +271,7 @@ class User implements ArrayAccess
*/
public function getLastName()
{
return $this->last_name;
return $this->container['last_name'];
}
/**
@ -269,7 +282,7 @@ class User implements ArrayAccess
public function setLastName($last_name)
{
$this->last_name = $last_name;
$this->container['last_name'] = $last_name;
return $this;
}
/**
@ -278,7 +291,7 @@ class User implements ArrayAccess
*/
public function getEmail()
{
return $this->email;
return $this->container['email'];
}
/**
@ -289,7 +302,7 @@ class User implements ArrayAccess
public function setEmail($email)
{
$this->email = $email;
$this->container['email'] = $email;
return $this;
}
/**
@ -298,7 +311,7 @@ class User implements ArrayAccess
*/
public function getPassword()
{
return $this->password;
return $this->container['password'];
}
/**
@ -309,7 +322,7 @@ class User implements ArrayAccess
public function setPassword($password)
{
$this->password = $password;
$this->container['password'] = $password;
return $this;
}
/**
@ -318,7 +331,7 @@ class User implements ArrayAccess
*/
public function getPhone()
{
return $this->phone;
return $this->container['phone'];
}
/**
@ -329,7 +342,7 @@ class User implements ArrayAccess
public function setPhone($phone)
{
$this->phone = $phone;
$this->container['phone'] = $phone;
return $this;
}
/**
@ -338,7 +351,7 @@ class User implements ArrayAccess
*/
public function getUserStatus()
{
return $this->user_status;
return $this->container['user_status'];
}
/**
@ -349,7 +362,7 @@ class User implements ArrayAccess
public function setUserStatus($user_status)
{
$this->user_status = $user_status;
$this->container['user_status'] = $user_status;
return $this;
}
/**
@ -359,7 +372,7 @@ class User implements ArrayAccess
*/
public function offsetExists($offset)
{
return isset($this->$offset);
return isset($this->container[$offset]);
}
/**
@ -369,7 +382,7 @@ class User implements ArrayAccess
*/
public function offsetGet($offset)
{
return $this->$offset;
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
@ -380,7 +393,11 @@ class User implements ArrayAccess
*/
public function offsetSet($offset, $value)
{
$this->$offset = $value;
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
@ -390,7 +407,7 @@ class User implements ArrayAccess
*/
public function offsetUnset($offset)
{
unset($this->$offset);
unset($this->container[$offset]);
}
/**

View File

@ -0,0 +1,70 @@
<?php
/**
* AnimalFarmTest
*
* PHP version 5
*
* @category Class
* @package Swagger\Client
* @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Copyright 2016 SmartBear Software
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Please update the test case below to test the model.
*/
namespace Swagger\Client\Model;
/**
* AnimalFarmTest Class Doc Comment
*
* @category Class
* @description
* @package Swagger\Client
* @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
* @link https://github.com/swagger-api/swagger-codegen
*/
class AnimalFarmTest extends \PHPUnit_Framework_TestCase
{
/**
* Setup before running each test case
*/
public static function setUpBeforeClass() {
}
/**
* Clean up after running each test case
*/
public static function tearDownAfterClass() {
}
/**
* Test AnimalFarm
*/
public function testAnimalFarm() {
}
}

View File

@ -423,6 +423,33 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
$this->assertSame('Dog', $new_dog->getClassName());
}
// test if ArrayAccess interface works
public function testArrayStuff()
{
// create an AnimalFarm which is an object implementing the
// ArrayAccess interface
$farm = new Swagger\Client\Model\AnimalFarm();
// add some animals to the farm to make sure the ArrayAccess
// interface works
$farm[] = new Swagger\Client\Model\Dog();
$farm[] = new Swagger\Client\Model\Cat();
$farm[] = new Swagger\Client\Model\Animal();
// assert we can look up the animals in the farm by array
// indices (let's try a random order)
$this->assertInstanceOf('Swagger\Client\Model\Cat', $farm[1]);
$this->assertInstanceOf('Swagger\Client\Model\Dog', $farm[0]);
$this->assertInstanceOf('Swagger\Client\Model\Animal', $farm[2]);
// let's try to `foreach` the animals in the farm and let's
// try to use the objects we loop through
foreach ($farm as $animal) {
$this->assertContains($animal->getClassName(), array('Dog', 'Cat', 'Animal'));
$this->assertInstanceOf('Swagger\Client\Model\Animal', $animal);
}
}
}
?>