Location::set - jcobban/Genealogy GitHub Wiki

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

Up: class Location

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
'latitude' The input value as a floating point number in degrees is converted to the internal representation and the return value is the former internal value converted to a floating point value in degrees.
'longitude' The input value as a floating point number in degrees is converted to the internal representation and the return value is the former internal value converted to a floating point value in degrees.
'location' The fields 'shortname', 'sortedlocation', and 'zoom' are initialized to follow the same rules described above for the class. See $location->setName($newName) for details.
'boundary' The supplied value may be either a string or an array of strings.

The support for interface ArrayAccess in the base class Record means that the following are equivalent:

    $location->set($field, $value);
    $location[$field]     = $value;

Next: Location::$colorNames