new Child - jcobban/Genealogy GitHub Wiki

new Child($parms)

Up: class Child

The constructor for an instance of Child 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. All of the field names must be valid lower class field names.
  • array('idcr' => integer) specifies the unique numeric key of the existing record in the table that is to be used to initialize the new instance.
  • array('idmr' => $idmr, 'idir' => $idir) identifies the record for a particular class Person identified by unique key as a child of a specific class Family identified by unique key. If the instance of Person is not already a child of the Family, this creates a new instance of Child. This is more commonly achieved by calling the factory method $family->addChild($idir).
  • array('idmr' => $family, 'idir' => $person) identifies the record for a particular class Person as a child of a specific class Family. If the instance of Person is not already a child of the Family, this creates a new instance of Child. This is more commonly achieved by calling the factory method $family->addChild($person).

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

Next: $child->getName()