Resolve typedefs in php generation
authorMark Slee <mcslee@apache.org>
Thu, 18 Jan 2007 20:00:11 +0000 (20:00 +0000)
committerMark Slee <mcslee@apache.org>
Thu, 18 Jan 2007 20:00:11 +0000 (20:00 +0000)
Reviewed By: xsd

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664927 13f79535-47bb-0310-9956-ffa450edef68

compiler/cpp/src/generate/t_php_generator.cc

index 9c3d7ed..1f77575 100644 (file)
@@ -830,9 +830,13 @@ void t_php_generator::generate_service_rest(t_service* tservice) {
     const vector<t_field*>& args = (*f_iter)->get_arglist()->get_members();
     vector<t_field*>::const_iterator a_iter;
     for (a_iter = args.begin(); a_iter != args.end(); ++a_iter) {
+      t_type* atype = (*a_iter)->get_type();
+      while (atype->is_typedef()) {
+        atype = ((t_typedef*)atype)->get_type();
+      }
       f_service_ <<
         indent() << "$" << (*a_iter)->get_name() << " = $request['" << (*a_iter)->get_name() << "'];" << endl;
-      if ((*a_iter)->get_type()->is_list()) {
+      if (atype->is_list()) {
         f_service_ << 
           indent() << "$" << (*a_iter)->get_name() << " = explode(',', $" << (*a_iter)->get_name() << ");" << endl;
       }