Person::addEvent - jcobban/Genealogy GitHub Wiki
$person->addEvent($event)
Up: class Person
This factory method adds a new Event to this Person. It has one parameter:
| parameter | description |
|---|---|
| $event | An instance of class Event or an associative array of parameters to initialize the instance of Event. If this parameter is omitted a default instance of Event is added with $event['idtype'] = Event::IDTYPE_INDIV and $event['idir'] = $this['idir'] which the caller must initialize with details. |
This method returns the instance of class Event that it has added.
For example:
if ($ider == 0 && $idet > 1)
{ // create new individual event
$event = $person->addEvent();
$ider = $event['ider'];
$event['idet'] = $idet; // type of event
$event['eventd'] = $internaldate; // date of event
$event['idlrevent'] = $idlr; // location of event
} // create new individual event