new Page - jcobban/Genealogy GitHub Wiki

new Page($parms)

Up: class Page

The constructor for an instance of Page 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('census' => $censusId, 'distid' => $distId, 'sdid' => $subdistId, 'div' => $div, 'sched' => $sched, 'pagenum' => $pagenum) specifies the unique compound key of the record in the table that is to be used to initialize the new instance.
  • array('sdid' => $subdistrict, 'pagenum' => $pagenum) identifies the instance of SubDistrict and the page number within that SubDistrict. It is generally more convenient in this situation to call $subdistrict->getPage($page) because that method does not create an instance if the value of $pagenum is invalid.

The constructor adds error messages to $record->msg, and the method $page->isValid() returns false if the constructor is unable to complete due to bad parameters.

Next: $page->getLine($linenum)