new Language - jcobban/Genealogy GitHub Wiki

new Language($parms)

Up: class Language

The constructor for an instance of Language takes one parameter:

parameter description
$parms identifies the database record to be associated with this instance. This is an associative array.

$parms may be:

  • An associative array containing all of the fields in a record as obtained by a database SELECT, or
  • array('code' => $code) or array('code639_1' => $code) specifies the unique string identifier of the record in the table that is to be used to initialize the new instance. Only the first 2 characters of this string are used to locate the record. If there are more than 2 characters and the 3rd character is a hyphen (-) then the remainder is saved as a country code, accessible by $language['cc'].
  • array('code639_2' => $code) specifies the unique 3 character string identifier specified by ISO 639-2 of the language record that is to be used to initialize the new instance .

The constructor adds error messages to $record->msg if it is unable to complete due to bad parameters. See $record->isValid() and $record->getErrors().

Next: $language->get($fieldname)