function Person($data, $simple = true) { if (is_array($data)) { // Construct from a row from the database $this->isdead = $data['i_isdead']; $this->sex = $data['i_sex']; } else { // Construct from raw GEDCOM data } parent::GedcomRecord($data, $simple); $this->dispname = $this->disp || showLivingNameById($this->xref); }
function Media($data) { if (is_array($data)) { // Construct from a row from the database $this->title = $data['m_titl']; $this->file = $data['m_file']; } else { // Construct from raw GEDCOM data $this->title = get_gedcom_value('TITL', 1, $data); if (empty($this->title)) { $this->title = get_gedcom_value('TITL', 2, $data); } $this->file = get_gedcom_value('FILE', 1, $data); } if (empty($this->title)) { $this->title = $this->file; } parent::GedcomRecord($data); }
/** * contstructor to create a new ServiceClient object * @param string $gedrec the SERV gedcom record */ function ServiceClient($gedrec) { //parse url //crate soap client class //authenticate/get/set sid parent::GedcomRecord($gedrec); //print "creating new service client ".$this->xref; //get the url from the gedcom $this->url = get_gedcom_value("URL", 1, $gedrec); $this->gedfile = get_gedcom_value("_DBID", 1, $gedrec); $this->title = get_gedcom_value("TITL", 1, $gedrec); $this->username = get_gedcom_value("_USER", 2, $gedrec); $this->password = get_gedcom_value("_PASS", 2, $gedrec); $this->type = "remote"; $this->data_type = "GEDCOM"; if (empty($this->url) && empty($this->gedfile)) { return null; } }
function Family($data, $simple = true) { if (is_array($data)) { // Construct from a row from the database if ($data['f_husb']) { $this->husb = Person::getInstance($data['f_husb']); } if ($data['f_wife']) { $this->wife = Person::getInstance($data['f_wife']); } if (strpos($data['f_chil'], ';')) { $this->childrenIds = explode(';', trim($data['f_chil'], ';')); } $this->numChildren = $data['f_numchil']; // Check for divorce *before* we privatize the data so we can correctly label spouses/ex-spouses $this->_isDivorced = (bool) preg_match('/\\n1 (' . PGV_EVENTS_DIV . ')( Y|\\n)/', $data['gedrec']); } else { // Construct from raw GEDCOM data if (preg_match('/^1 HUSB @(.+)@/m', $data, $match)) { $this->husb = Person::getInstance($match[1], $simple); } if (preg_match('/^1 WIFE @(.+)@/m', $data, $match)) { $this->wife = Person::getInstance($match[1], $simple); } if (preg_match_all('/^1 CHIL @(.+)@/m', $data, $match)) { $this->childrenIds = $match[1]; } if (preg_match('/^1 NCHI (\\d+)/m', $data, $match)) { $this->numChildren = $match[1]; } else { $this->numChildren = count($this->childrenIds); } // Check for divorce *before* we privatize the data so we can correctly label spouses/ex-spouses $this->_isDivorced = (bool) preg_match('/\\n1 (' . PGV_EVENTS_DIV . ')( Y|\\n)/', $data); } // 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); } parent::GedcomRecord($data); }