new Event - jcobban/Genealogy GitHub Wiki

new Event($parms)

Up: class Event

The constructor for an instance of Event 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('ider' => integer) specifies the unique numeric key of the record in the table that is to be used to initialize the new instance.
  • array('idir' => $idir, 'idtype' => Event::IDTYPE_INDIV) builds a new instance for the specific type in relation to the record identified by the ‘idir’ value. In this case it creates a new individual event record. The value of the ‘idir’ parameter may be an instance of Record appropriate for the specified type. If it is the Event constructor does not have to create a new instance to return from method $event->getAssociatedRecord(). In this case ‘idir’ must either be an integer or an instance of Person. Although the name of the field is 'idir' it can be a reference to a Person, Family, or Child as indicated by the 'idtype' field value.

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

Next: $event->getName()