forked from loafle/openapi-generator-original
Merge pull request #502 from FindTheBest/develop_2.0
PHP Generated Models
This commit is contained in:
commit
4f32e9dbff
@ -24,7 +24,7 @@
|
||||
{{#models}}
|
||||
{{#model}}
|
||||
|
||||
class {{classname}} {
|
||||
class {{classname}} implements ArrayAccess {
|
||||
static $swaggerTypes = array(
|
||||
{{#vars}}'{{name}}' => '{{{datatype}}}'{{#hasMore}},
|
||||
{{/hasMore}}{{/vars}}
|
||||
@ -35,6 +35,27 @@ class {{classname}} {
|
||||
* {{{description}}}
|
||||
*/{{/description}}
|
||||
public ${{name}}; /* {{{datatype}}} */{{/vars}}
|
||||
|
||||
public function __construct(array $data) {
|
||||
{{#vars}}$this->{{name}} = $data["{{name}}"];{{#hasMore}}
|
||||
{{/hasMore}}{{/vars}}
|
||||
}
|
||||
|
||||
public function offsetExists($offset) {
|
||||
return isset($this->$offset);
|
||||
}
|
||||
|
||||
public function offsetGet($offset) {
|
||||
return $this->$offset;
|
||||
}
|
||||
|
||||
public function offsetSet($offset, $value) {
|
||||
$this->$offset = $value;
|
||||
}
|
||||
|
||||
public function offsetUnset($offset) {
|
||||
unset($this->$offset);
|
||||
}
|
||||
}
|
||||
{{/model}}
|
||||
{{/models}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user