Domain::set - jcobban/Genealogy GitHub Wiki
$domain->set($fieldname, $value)
Up: class Domain
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 |
---|---|
'domain' | The input value may be specified in the format specified by ISO 3166-2 or the hyphen between the country code and the state identifier may be omitted. |
'countrycode' | The value replaces the first 2 characters of the domain identifier. |
'state' | The value replaces the portion of the domain identifier after the country code and hyphen. |
'partof' | If the supplied value is null or is equal to the country code portion of 'domain' then the field is set to null . If the first two characters of the supplied value are not equal to the country code portion of 'domain' the field is not changed. If the supplied value does not have a hyphen between the country code and sub-domain identifier one is inserted. |
Examples:
$domain->set('domain', 'AUNSW');
$domain->set('domain', 'AU-NSW');
Next: $domain->getCountry()