Skip to content

Handle other unmapped enum values somehow - _unmapped ? #18

@andzandz

Description

@andzandz

For example, the old feed system rightmove template has this

 //loop through the props
      foreach ($o_x_props as $prop)
      {
        // Only if sellingState type is 'V' (Vente)
        if ($xpath->query('sellingState', $prop)->item(0)->nodeValue == 'V')
        {

So <sellingState>V</sellingState> means, this property is for sale. I set this enum definition:

    sale_status:
      for_sale:                                   [V]
      let:                                        []
      sold:                                       []
      sold_subject_to_contract:                   []
      to_let:                                     []
      under_offer:                                []
      withdrawn:                                  []

So what do I set as Default? I don't know what the other feed values mean - defaulting it to Sold would be wrong. If I default it to null (or just remove this mapping entirely) the loader will just default sale_status to for_sale anyway.

I suppose this is explicitly unknown, like _unclassified property type. When the sale_status is unknown, we just default it to for_sale. So perhaps we need _unmapped:

    sale_status:
      for_sale:                                   [V]
      _unmapped:                                  [Default]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions