mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-06-29 12:10:54 +00:00
fix getter for allowableValues for php enum
This commit is contained in:
parent
800a858acb
commit
2c9e9ee425
@ -109,18 +109,18 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA
|
||||
{{#vars}}{{#isEnum}}{{#allowableValues}}{{#enumVars}}const {{datatypeWithEnum}}_{{{name}}} = "{{{value}}}";
|
||||
{{/enumVars}}{{/allowableValues}}{{/isEnum}}{{/vars}}
|
||||
|
||||
{{#isEnum}}
|
||||
{{#vars}}{{#isEnum}}
|
||||
/**
|
||||
* Gets allowable values of the enum
|
||||
* @return string[]
|
||||
*/
|
||||
public function {{getter}}AllowableValues() {
|
||||
return [
|
||||
{{#allowableValues}}{{#values}}self::{{datatypeWithEnum}}_{{{this}}},{{^-last}}
|
||||
{{/-last}}{{/values}}{{/allowableValues}}
|
||||
{{#allowableValues}}{{#enumVars}}self::{{datatypeWithEnum}}_{{{name}}},{{^-last}}
|
||||
{{/-last}}{{/enumVars}}{{/allowableValues}}
|
||||
];
|
||||
}
|
||||
{{/isEnum}}
|
||||
{{/isEnum}}{{/vars}}
|
||||
|
||||
{{#vars}}
|
||||
/**
|
||||
|
@ -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-02T19:03:06.710+08:00
|
||||
- Build date: 2016-04-02T19:17:12.338+08:00
|
||||
- Build package: class io.swagger.codegen.languages.PhpClientCodegen
|
||||
|
||||
## Requirements
|
||||
|
@ -120,6 +120,18 @@ class InlineResponse200 implements ArrayAccess
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Gets allowable values of the enum
|
||||
* @return string[]
|
||||
*/
|
||||
public function getStatusAllowableValues() {
|
||||
return [
|
||||
self::STATUS_AVAILABLE,
|
||||
self::STATUS_PENDING,
|
||||
self::STATUS_SOLD,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -120,6 +120,18 @@ class Order implements ArrayAccess
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Gets allowable values of the enum
|
||||
* @return string[]
|
||||
*/
|
||||
public function getStatusAllowableValues() {
|
||||
return [
|
||||
self::STATUS_PLACED,
|
||||
self::STATUS_APPROVED,
|
||||
self::STATUS_DELIVERED,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -120,6 +120,18 @@ class Pet implements ArrayAccess
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Gets allowable values of the enum
|
||||
* @return string[]
|
||||
*/
|
||||
public function getStatusAllowableValues() {
|
||||
return [
|
||||
self::STATUS_AVAILABLE,
|
||||
self::STATUS_PENDING,
|
||||
self::STATUS_SOLD,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user