Exemplo n.º 1
0
 /**
  * Extracts attribute contents FROM a parent tree object
  *
  * @param array  $tree an array containing an array FROM which the
  *                     object data should be extracted
  * @param string $ver  represents the version of the GEDCOM standard
  *                     data is being extracted from
  *
  * @return void
  *
  * @access public
  * @since Method available since Release 0.0.1
  */
 public function parse_tree($tree, $ver)
 {
     $this->ver = $ver;
     if (($i1 = parent::find_tag($tree, Rp_Tags::SOURCE)) !== false) {
         $this->source_id = parent::parse_ptr_id($tree[$i1], Rp_Tags::SOURCE);
         if (isset($tree[$i1][1])) {
             $sub2 = $tree[$i1][1];
             if (($i2 = parent::find_tag($sub2, Rp_Tags::PAGE)) !== false) {
                 $this->page = parent::parse_text($sub2[$i2], Rp_Tags::PAGE);
             }
             if (($i2 = parent::find_tag($sub2, Rp_Tags::QUAY)) !== false) {
                 $this->quay = parent::parse_text($sub2[$i2], Rp_Tags::QUAY);
             }
             if (($i2 = parent::find_tag($sub2, Rp_Tags::EVENTTYPE)) !== false) {
                 $this->event_type = parent::parse_text($sub2[$i2], Rp_Tags::EVENTTYPE);
                 if (isset($sub2[$i2][1])) {
                     if (($i3 = parent::find_tag($sub2[$i2][1], Rp_Tags::ROLE)) !== false) {
                         $this->role_in_event = parent::parse_text($sub2[$i2][1][$i3], Rp_Tags::ROLE);
                     }
                 }
             }
             if (($i2 = parent::find_tag($sub2, Rp_Tags::DATA)) !== false) {
                 $sub3 = $sub2[$i2][1];
                 if (isset($sub3)) {
                     if (($i3 = parent::find_tag($sub3, Rp_Tags::DATE)) !== false) {
                         $this->entry_date = parent::parse_text($sub3[$i3], Rp_Tags::DATE);
                     }
                     $off = 0;
                     while (($i3 = parent::find_tag($sub3, Rp_Tags::TEXT, $off)) !== false) {
                         $this->texts[] = parent::parse_con_tag($sub3[$i3], Rp_Tags::TEXT);
                         $off = $i3 + 1;
                     }
                 }
             }
             $off = 0;
             while (($i2 = parent::find_tag($sub2, Rp_Tags::MEDIA, $off)) !== false) {
                 $tmp = new RP_Media_Link();
                 $tmp->parse_tree(array($sub2[$i2]), $ver);
                 $this->media_links[] = $tmp;
                 $off = $i2 + 1;
             }
             $off = 0;
             while (($i2 = parent::find_tag($sub2, Rp_Tags::NOTE, $off)) !== false) {
                 $tmp = new RP_Note();
                 $tmp->parse_tree(array($sub2[$i2]), $ver);
                 $this->notes[] = $tmp;
                 $off = $i2 + 1;
             }
         }
     }
 }
 /**
  * Extracts attribute contents FROM a parent tree object
  *
  * @param array  $tree an array containing an array FROM which the
  *                     object data should be extracted
  * @param string $ver  represents the version of the GEDCOM standard
  *                     data is being extracted from
  *
  * @return void
  *
  * @access public
  * @since Method available since Release 0.0.1
  */
 public function parse_tree($tree, $ver)
 {
     $this->id = parent::parse_ref_id($tree[0], Rp_Tags::SUBMITTER);
     if (isset($tree[0][1])) {
         $sub2 = $tree[0][1];
         if (($i1 = parent::find_tag($sub2, Rp_Tags::NAME)) !== false) {
             $this->name = parent::parse_text($sub2[$i1], Rp_Tags::NAME);
         }
         $this->address->parse_tree($sub2, $ver);
         $off = 0;
         while (($i1 = parent::find_tag($sub2, Rp_Tags::MEDIA, $off)) !== false) {
             $tmp = new RP_Media_Link();
             $tmp->parse_tree(array($sub2[$i1]), $ver);
             $this->media_links[] = $tmp;
             $off = $i1 + 1;
         }
         if (($i1 = parent::find_tag($sub2, Rp_Tags::LANGUAGE)) !== false) {
             $this->language = parent::parse_text($sub2[$i1], Rp_Tags::LANGUAGE);
         }
         if (($i1 = parent::find_tag($sub2, Rp_Tags::RFN)) !== false) {
             $this->submitter_ref_nbr = parent::parse_text($sub2[$i1], Rp_Tags::RFN);
         }
         if (($i1 = parent::find_tag($sub2, Rp_Tags::AUTORECID)) !== false) {
             $this->auto_rec_id = parent::parse_text($sub2[$i1], Rp_Tags::AUTORECID);
         }
         if (($i1 = parent::find_tag($sub2, Rp_Tags::CHANGEDATE)) !== false) {
             $this->change_date->parse_tree(array($sub2[$i1]), $ver);
         }
         $off = 0;
         while (($i1 = parent::find_tag($sub2, Rp_Tags::NOTE, $off)) !== false) {
             $tmp = new RP_Note();
             $tmp->parse_tree(array($sub2[$i1]), $ver);
             $this->notes[] = $tmp;
             $off = $i1 + 1;
         }
     }
 }
 /**
  * @todo Description of function mediaParseTree
  * @param  $subTree
  * @param  $ver
  * @return
  */
 public function media_parse_tree($sub_tree, $ver)
 {
     $off = 0;
     while (($i1 = parent::find_tag($sub_tree, Rp_Tags::MEDIA, $off)) !== false) {
         $tmp = new RP_Media_Link();
         $tmp->parse_tree(array($sub_tree[$i1]), $ver);
         $this->media_links[] = $tmp;
         $off = $i1 + 1;
     }
 }
Exemplo n.º 4
0
 /**
  * Extracts attribute contents FROM a parent tree object
  *
  * @param array  $tree an array containing an array FROM which the
  *                     object data should be extracted
  * @param string $ver  represents the version of the GEDCOM standard
  *                     data is being extracted from
  *
  * @return void
  *
  * @access public
  * @since Method available since Release 0.0.1
  */
 protected function parse_tree_detail($tree, $ver)
 {
     if (($i1 = parent::find_tag($tree, Rp_Tags::TYPE)) !== false) {
         $this->type = parent::parse_text($tree[$i1], Rp_Tags::TYPE);
     }
     if (($i1 = parent::find_tag($tree, Rp_Tags::DATE)) !== false) {
         $this->date = parent::parse_text($tree[$i1], Rp_Tags::DATE);
     }
     if (($i1 = parent::find_tag($tree, Rp_Tags::ADDRESS)) !== false) {
         $this->address->parse_tree(array($tree[$i1]), $ver);
     }
     if (($i1 = parent::find_tag($tree, Rp_Tags::PLACE)) !== false) {
         $this->place->parse_tree(array($tree[$i1]), $ver);
     }
     if (($i1 = parent::find_tag($tree, Rp_Tags::RELIGION)) !== false) {
         $this->religious_affiliation = parent::parse_text($tree[$i1], Rp_Tags::RELIGION);
     }
     if (($i1 = parent::find_tag($tree, Rp_Tags::AGENCY)) !== false) {
         $this->resp_agency = parent::parse_text($tree[$i1], Rp_Tags::AGENCY);
     }
     if (($i1 = parent::find_tag($tree, Rp_Tags::AGE)) !== false) {
         $this->age = parent::parse_text($tree[$i1], Rp_Tags::AGE);
     }
     if (($i1 = parent::find_tag($tree, Rp_Tags::RESTRICTION)) !== false) {
         $this->restriction = parent::parse_text($tree[$i1], Rp_Tags::RESTRICTION);
     }
     if (($i1 = parent::find_tag($tree, Rp_Tags::CAUSE)) !== false) {
         $this->cause = parent::parse_text($tree[$i1], Rp_Tags::CAUSE);
     }
     if (isset($this->place)) {
         $this->place->parse_tree($tree, $ver);
     }
     if (isset($this->address)) {
         $this->address->parse_tree($tree, $ver);
     }
     $off = 0;
     while (($i1 = parent::find_tag($tree, Rp_Tags::CITE, $off)) !== false) {
         $tmp = new RP_Citation();
         $tmp->parse_tree(array($tree[$i1]), $ver);
         $this->citations[] = $tmp;
         $off = $i1 + 1;
     }
     $off = 0;
     while (($i1 = parent::find_tag($tree, Rp_Tags::MEDIA, $off)) !== false) {
         $tmp = new RP_Media_Link();
         $tmp->parse_tree(array($tree[$i1]), $ver);
         $this->media_links[] = $tmp;
         $off = $i1 + 1;
     }
     $off = 0;
     while (($i1 = parent::find_tag($tree, Rp_Tags::NOTE, $off)) !== false) {
         $tmp = new RP_Note();
         $tmp->parse_tree(array($tree[$i1]), $ver);
         $this->notes[] = $tmp;
         $off = $i1 + 1;
     }
 }