php - Data Gateway Pattern and Foreign Keys -


how 2 concepts work ?

i have scenario

  • city table
  • country table
  • city.country_id fk country.id

    objective

  • fetch cities , display country name also

    my problem

  • fetch method cities table
  • if need country name have search or inner join doing make queries when not necessary (display city info example)

    question

  • what right way apply data gateway pattern in case.

  • you should use join if need h associated country name. add method fetchwithcountry.


    Comments

    Popular posts from this blog

    c# - IMAP GMAIL getting folder list problem -

    PHP proxy to get XML: problem with URL arguments -