Family::setName - jcobban/Genealogy GitHub Wiki
$family->setName($person)
Up: class Family
This method synchronizes information about one of the spouses between the instance of class Person
or class Name
for that individual and this instance of class Family
.
This method has one parameter:
parameter | contents |
---|---|
$person | If this is an instance of class Person the name and birth date information in this instance of class Family is updated to match the Person , including setting either idirhusb or idirwife to reference the instance of Person depending upon the gender of $person . If this is an instance of class Name the name information in this instance of class Family is updated to match the Name, including setting either idirhusb or idirwife to match the value of field idir in the instance of Name depending upon the gender of the Person identified by that idir . If it is integer 0 the information about the male partner is cleared, including clearing field idirhusb . If it is integer 1 the information about the female partner is cleared, including clearing field idirwife . |
This method exists because the original database design did not conform to 3rd Normal Form (3NF) in that specific items of information were stored in multiple records, which all needed to be updated together any time one of those values was changed. In particular the surname and given name were present in three records, and the birth date (in YYYYMMDD format) was present in four records. In the current design model the surname and given name is only defined in the class Name
and class Person
and class Family
simulate the fields that formerly contained copies of that information, and the birth date (in YYYYMMDD format) only appears in the class Event
and class Person
, class Family
, and class Name
simulate the fields that formerly contained copies of the birth date. However a thorough code review has not yet been undertaken to ensure that there is no code that accesses this information in a way that bypasses the new implementation.