(self, unused_api, prop, schema)
Annotate properties with a PHP type hint.

    Overrides default implementation.

    Args:
      unused_api: (Api) The API this Property belongs to.
      prop: (Property) The Property to annotate.
      schema: (Schema) The Schema this Property belongs to.
Annotate properties with a PHP type hint.
Annotate properties with a PHP type hint .
def AnnotateProperty(self, unused_api, prop, schema):
    """Annotate properties with a PHP type hint.

    Overrides default implementation.

    Args:
      unused_api: (Api) The API this Property belongs to.
      prop: (Property) The Property to annotate.
      schema: (Schema) The Schema this Property belongs to.
    """
    if isinstance(prop.data_type, data_types.ArrayDataType):
      prop.SetTemplateValue('dataType', 'array')
      schema.SetTemplateValue('dataType', 'array')
      collection = self.language_model.ToMemberName(prop['wireName'], 0)
      schema.SetTemplateValue('collectionKey', collection)
    elif not schema.GetTemplateValue('dataType'):
      schema.SetTemplateValue('dataType', 'object')

    if isinstance(prop.data_type, data_types.MapDataType):
      prop.SetTemplateValue('dataType', 'map')

    if not prop.member_name_is_json_name:
      schema.SetTemplateValue('has_gapi', True)

    #  add the prop name
    prop_names = schema.values.get('propNames', [])
    prop_names.append(prop.memberName)
    schema.SetTemplateValue('propNames', prop_names)

    self._SetTypeHint(prop)
def AnnotateProperty ( self , unused_api , prop , schema ) : if isinstance ( prop . data_type , data_types . ArrayDataType ) : prop . SetTemplateValue ( 'dataType' , 'array' ) schema . SetTemplateValue ( 'dataType' , 'array' ) collection = self . language_model . ToMemberName ( prop [ 'wireName' ] , 0 ) schema . SetTemplateValue ( 'collectionKey' , collection ) elif not schema . GetTemplateValue ( 'dataType' ) : schema . SetTemplateValue ( 'dataType' , 'object' ) if isinstance ( prop . data_type , data_types . MapDataType ) : prop . SetTemplateValue ( 'dataType' , 'map' ) if not prop . member_name_is_json_name : schema . SetTemplateValue ( 'has_gapi' , True ) #  add the prop name prop_names = schema . values . get ( 'propNames' , [ ] ) prop_names . append ( prop . memberName ) schema . SetTemplateValue ( 'propNames' , prop_names ) self . _SetTypeHint ( prop )