Township::set - jcobban/Genealogy GitHub Wiki

$township->set($fieldname, $value)

Up: class Township

This changes the value of the identified field and returns the former value. It has two parameters:

parameter description
$field The field name is case insensitive and may be a synonym defined by the derived class to facilitate readability. Late static binding is used so this method takes advantage of field name definitions in the derived class. The field name may also be a temporary field defined by assigning a value to it in this method. This method creates a trace entry if the field name does not correspond to any field in the record and debugging is enabled.
$value The new value to assign to the field.

It overloads the base implementation as follows:

field name description
'location' The input value is a positive integer which is the internal key of an instance of class Location. If the value is not a positive integer it is ignored and the current value is returned.

Next: $township->getName()