Thrift: Add field type to generated union struct for hack generator
Thrift: Add field type to generated union struct for hack generator

Summary:
In cpp/py, there is a getType() for union which allow us
to determine in O(1) which field is set in union. In php, we don't
have this capability, so I added it now.

Long term is to properly have a seperate generator function for union
instead of treating it like a struct with all union member

Test Plan:
manually used in https://phabricator.fb.com/D1823774

Reviewed By: ckwalsh@fb.com

Subscribers: trunkagent, alandau, mshneer, yfeldblum, robertkarl, pdowell

FB internal diff: D1823795

Tasks: 6157062

Signature: t1:1823795:1423162707:9830219c036a153dc0119553ddaea3b33a9c808e

fengshao0907/fbthrift,raphaelamorim/fbthrift,guker/fbthrift,Orvid/fbthrift,getyourguide/fbthrift,maxwell-demon/fbthrift,LinusU/fbthrift,chjp2046/fbthrift,guker/fbthrift,project-zerus/fbthrift,LinusU/fbthrift,soumith/fbthrift,chjp2046/fbthrift,soumith/fbthrift,facebook/fbthrift,Orvid/fbthrift,fengshao0907/fbthrift,getyourguide/fbthrift,facebook/fbthrift,sinjar666/fbthrift,getyourguide/fbthrift,project-zerus/fbthrift,LinusU/fbthrift,getyourguide/fbthrift,maxwell-demon/fbthrift,Orvid/fbthrift,Orvid/fbthrift,sinjar666/fbthrift,SergeyMakarenko/fbthrift,chjp2046/fbthrift,Orvid/fbthrift,kangkot/fbthrift,kangkot/fbthrift,soumith/fbthrift,fengshao0907/fbthrift,SergeyMakarenko/fbthrift,SergeyMakarenko/fbthrift,HankFaan/fbthrift,chjp2046/fbthrift,raphaelamorim/fbthrift,kangkot/fbthrift,maxwell-demon/fbthrift,SergeyMakarenko/fbthrift,SergeyMakarenko/fbthrift,fengshao0907/fbthrift,SergeyMakarenko/fbthrift,Orvid/fbthrift,SergeyMakarenko/fbthrift,getyourguide/fbthrift,facebook/fbthrift,sinjar666/fbthrift,Orvid/fbthrift,project-zerus/fbthrift,sinjar666/fbthrift,kangkot/fbthrift,kangkot/fbthrift,facebook/fbthrift,getyourguide/fbthrift,raphaelamorim/fbthrift,maxwell-demon/fbthrift,HankFaan/fbthrift,LinusU/fbthrift,soumith/fbthrift,guker/fbthrift,kangkot/fbthrift,getyourguide/fbthrift,maxwell-demon/fbthrift,fengshao0907/fbthrift,sinjar666/fbthrift,kangkot/fbthrift,project-zerus/fbthrift,project-zerus/fbthrift,getyourguide/fbthrift,chjp2046/fbthrift,facebook/fbthrift,guker/fbthrift,soumith/fbthrift,SergeyMakarenko/fbthrift,project-zerus/fbthrift,maxwell-demon/fbthrift,LinusU/fbthrift,project-zerus/fbthrift,getyourguide/fbthrift,facebook/fbthrift,sinjar666/fbthrift,SergeyMakarenko/fbthrift,project-zerus/fbthrift,getyourguide/fbthrift,HankFaan/fbthrift,maxwell-demon/fbthrift,SergeyMakarenko/fbthrift,fengshao0907/fbthrift,LinusU/fbthrift,sinjar666/fbthrift,fengshao0907/fbthrift,LinusU/fbthrift,project-zerus/fbthrift,chjp2046/fbthrift,chjp2046/fbthrift,soumith/fbthrift,facebook/fbthrift,maxwell-demon/fbthrift,HankFaan/fbthrift,kangkot/fbthrift,kangkot/fbthrift,sinjar666/fbthrift,sinjar666/fbthrift,SergeyMakarenko/fbthrift,sinjar666/fbthrift,HankFaan/fbthrift,facebook/fbthrift,raphaelamorim/fbthrift,Orvid/fbthrift,soumith/fbthrift,LinusU/fbthrift,guker/fbthrift,guker/fbthrift,fengshao0907/fbthrift,soumith/fbthrift,guker/fbthrift,raphaelamorim/fbthrift,soumith/fbthrift,fengshao0907/fbthrift,Orvid/fbthrift,kangkot/fbthrift,chjp2046/fbthrift,chjp2046/fbthrift,HankFaan/fbthrift,HankFaan/fbthrift,chjp2046/fbthrift,kangkot/fbthrift,fengshao0907/fbthrift,raphaelamorim/fbthrift,Orvid/fbthrift,facebook/fbthrift,raphaelamorim/fbthrift,maxwell-demon/fbthrift,raphaelamorim/fbthrift,LinusU/fbthrift,getyourguide/fbthrift,SergeyMakarenko/fbthrift,soumith/fbthrift,HankFaan/fbthrift,HankFaan/fbthrift,maxwell-demon/fbthrift,guker/fbthrift,chjp2046/fbthrift,guker/fbthrift,raphaelamorim/fbthrift,sinjar666/fbthrift,soumith/fbthrift,raphaelamorim/fbthrift,Orvid/fbthrift,HankFaan/fbthrift,getyourguide/fbthrift,project-zerus/fbthrift,guker/fbthrift,guker/fbthrift,project-zerus/fbthrift,LinusU/fbthrift,maxwell-demon/fbthrift,LinusU/fbthrift,HankFaan/fbthrift,chjp2046/fbthrift,fengshao0907/fbthrift,raphaelamorim/fbthrift,project-zerus/fbthrift