new Census - jcobban/Genealogy GitHub Wiki

new Census($parms)

Up: class Census

The constructor for an instance of Census 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.
  • array('censusid' => string) specifies the unique identifier of the record in the table that is to be used to initialize the new instance.
  • array('name' => string) specifies the unique name of the record in the table that is to be used to initialize the new instance.

For example:

$census        = new Census(array('censusid' => 'CA1881'));
$census        = new Census(array('name' => '1881 Census of Canada'));

The constructor adds error messages to $record->msg if it is unable to complete due to bad parameters.

Next: $census->getName()