public function __construct($xref, $gedcom, $pending, $gedcom_id) { parent::__construct($xref, $gedcom, $pending, $gedcom_id); // TODO get this data from WT_Fact objects if (preg_match('/\\n1 FILE (.+)/', $gedcom . $pending, $match)) { $this->file = $match[1]; } else { $this->file = ''; } if (preg_match('/\\n\\d TITL (.+)/', $gedcom . $pending, $match)) { $this->title = $match[1]; } else { $this->title = $this->file; } }
function __construct($xref, $gedcom, $pending, $gedcom_id) { parent::__construct($xref, $gedcom, $pending, $gedcom_id); // Fetch husband and wife if (preg_match('/^1 HUSB @(.+)@/m', $gedcom . $pending, $match)) { $this->husb = WT_Individual::getInstance($match[1]); } if (preg_match('/^1 WIFE @(.+)@/m', $gedcom . $pending, $match)) { $this->wife = WT_Individual::getInstance($match[1]); } // Make sure husb/wife are the right way round. if ($this->husb && $this->husb->getSex() == 'F' || $this->wife && $this->wife->getSex() == 'M') { list($this->husb, $this->wife) = array($this->wife, $this->husb); } }