mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-06-29 20:20:53 +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}}}";
|
{{#vars}}{{#isEnum}}{{#allowableValues}}{{#enumVars}}const {{datatypeWithEnum}}_{{{name}}} = "{{{value}}}";
|
||||||
{{/enumVars}}{{/allowableValues}}{{/isEnum}}{{/vars}}
|
{{/enumVars}}{{/allowableValues}}{{/isEnum}}{{/vars}}
|
||||||
|
|
||||||
{{#isEnum}}
|
{{#vars}}{{#isEnum}}
|
||||||
/**
|
/**
|
||||||
* Gets allowable values of the enum
|
* Gets allowable values of the enum
|
||||||
* @return string[]
|
* @return string[]
|
||||||
*/
|
*/
|
||||||
public function {{getter}}AllowableValues() {
|
public function {{getter}}AllowableValues() {
|
||||||
return [
|
return [
|
||||||
{{#allowableValues}}{{#values}}self::{{datatypeWithEnum}}_{{{this}}},{{^-last}}
|
{{#allowableValues}}{{#enumVars}}self::{{datatypeWithEnum}}_{{{name}}},{{^-last}}
|
||||||
{{/-last}}{{/values}}{{/allowableValues}}
|
{{/-last}}{{/enumVars}}{{/allowableValues}}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
{{/isEnum}}
|
{{/isEnum}}{{/vars}}
|
||||||
|
|
||||||
{{#vars}}
|
{{#vars}}
|
||||||
/**
|
/**
|
||||||
|
@ -5,7 +5,7 @@ This PHP package is automatically generated by the [Swagger Codegen](https://git
|
|||||||
|
|
||||||
- API version: 1.0.0
|
- API version: 1.0.0
|
||||||
- Package 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
|
- Build package: class io.swagger.codegen.languages.PhpClientCodegen
|
||||||
|
|
||||||
## Requirements
|
## 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