Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Currently we are losing the connection between the structure enum parameter value and the enum definition itself in PHP.
The following thrift parameter which is using GroupType enum:
5: required GroupType group_type;
Is compiled to PHP:
5 => array( 'var' => 'group_type', 'isRequired' => true, 'type' => TType::I32, ),
Which means that we cannot say on PHP side if that is a regular i32 or an enum.
Why do I need that?
I am using lowercase enum values instead of integers in database and on the frontend. Currently converting them by manually specifying the Enum Classes for enum parameters for each Structure which is not scalable, more difficult to maintain and growing over time.
This also makes it impossible to validate fields by Enum values on php side.
Attachments
Issue Links
- links to