Skip to content

new CountyMarriage

James Cobban edited this page May 20, 2021 · 3 revisions

new CountyMarriage($parms)

Up: class CountyMarriage

The constructor for an instance of CountyMarriage 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('domain' => $domain, 'volume' => $volume, 'reportno' => $reportno, 'itemno' => $item, 'role' => $item) specifies the unique identification of the record in the table that is to be used to initialize the new instance or the identification of a new record to be created.
  • array('reportno' => $report, 'itemno' => $item, 'role' => $item), where $report is an instance of class CountyMarriageReport specifies the unique identification of the record in the report that is to be used to initialize the new instance or the identification of a new record to be created.

Note that $domain may be either the unique character string identifier of an instance of class Domain or else an instance of class Domain

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

    $domain              = new Domain(array('domain' => 'CAON', 'lang' => 'en'));
    $report              = new CountyMarriageReport(array('domain' => 'CAON', 'volume' => 36, 'reportno' => 109));
    $countyMarriage      = new CountyMarriage(array('domain' => 'CAON', 'volume' => 36, 'reportno' => 109, 'item' => 3, 'role' => 'G');
    $countyMarriage      = new CountyMarriage(array('domain' => $domain, 'volume' => 36, 'reportno' => 109, 'item' => 3, 'role' => 'G');
    $countyMarriage      = new CountyMarriage(array('reportno' => $report, 'item' => 3, 'role' => 'G');

All three constructors return an instance representing the same record in the database.

Next: $countyMarriage->getName()

Clone this wiki locally