THRIFT-4942 Set PHP struct generated field values as private with getters and setters

Client: php
Patch: Das Dedipyaman

This closes #2245

Update field access for getters_setters flag. FFields are private if getters_setters are set, otherwise, public.
This commit is contained in:
Dedipyaman Das 2020-09-27 02:29:23 +05:30 committed by Jens Geyer
parent c553155af8
commit 6fd830d690

View File

@ -939,7 +939,8 @@ void t_php_generator::generate_php_struct_definition(ostream& out,
dval = render_const_value((*m_iter)->get_type(), (*m_iter)->get_value());
}
generate_php_doc(out, *m_iter);
indent(out) << "public $" << (*m_iter)->get_name() << " = " << dval << ";" << endl;
string access = (getters_setters_) ? "private" : "public";
indent(out) << access << " $" << (*m_iter)->get_name() << " = " << dval << ";" << endl;
}
out << endl;