Census::get - jcobban/Genealogy GitHub Wiki
$census->get($fieldname)
Up: class Census
This gets the current value of the identified field. It has one parameter:
parameter | description |
---|---|
$field | The field name is case insensitive and may be a synonym defined by the derived class to facilitate readability. The field name may also be a temporary field defined by assigning a value to it in the set method. This method creates a trace entry if the field name does not correspond to any field in the record and debugging is enabled. |
It overloads the base implementation as follows:
field name | description |
---|---|
'partof' | returns an empty string for national enumerations or the ISO 3166-1 2-character country code for enumerations of states or provinces within a country. For example the instance of Census with id 'CW1861' returns 'CA'. |
'idsr' | returns 1, the key of the empty Source, if the field is null . |
'cc' | returns the ISO 3166-1 country code which is the value of partof if that is defined or else the first two characters of the census identifier. |
'countrycode' | returns the ISO 3166-1ISO country code which is the value of partof if that is defined or else the first two characters of the census identifier. |
'province' | for a census of an individual state, province, or colony within a federal state this returns the identifier portion of the census identifier. Otherwise it returns an empty string. For example for the census 'CW1851' this is 'CW', for the census 'USMI1890' this is 'MI', for the census 'CA1881' this is null. See ISO 3166-2. |
'year' | returns the enumeration year portion of the census identifier as an integer. |
'table' | returns the SQL table name that contains the transcription of this census. |
This method returns the current value of the field. If the field normally contains a string but its value is null
the method returns an empty string. This method returns null
if the field name does not correspond to any field in the record, and generates a warning message if debugging is enabled.
Next: $census->getStats()