Source for file Genealogy_Gedcom.php
Documentation is available at Genealogy_Gedcom.php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Olivier Vanhoucke <olivier@php.net> |
// +----------------------------------------------------------------------+
// $Id: Genealogy_Gedcom.php,v 1.2 2003/01/04 11:54:56 mj Exp $
require_once 'Gedcom/Parser.php';
* require_once 'Genealogy/Gedcom.php';
* $ged =& new Genealogy_Gedcom('test.ged');
* echo 'Number of individuals : '. $ged->getNumberOfIndividuals().'<br>';
* echo 'Number of families : '. $ged->getNumberOfFamilies(). '<br>';
* echo 'Number of objects :' . $ged->getNumberOfObjects(). '<br>';
* echo 'Last Update :'. $ged->getLastUpdate(). '<br>';
* print_r($ged->GedcomIndividualsTreeObjects);
* print_r($ged->GedcomFamiliesTreeObjects);
* print_r($ged->GedcomObjectsTreeObjects);
* print_r($ged->GedcomHeaderTreeObject);
* print_r($ged->getIndividual('I1'));
* print_r($ged->getFamily('F1'));
* print_r($ged->getObject('O1'));
* display all firstname and lastname of individuals
* foreach ($ged->GedcomIndividualsTreeObjects as $obj) {
* echo $obj->Firstname.' '.$obj->Lastname.'<br>';
* @author Olivier Vanhoucke <olivier@php.net>
* @version $Revision: 1.2 $
* @package Genealogy_Gedcom
* Creates a new Genealogy_Gedcom Object
* @param string Gedcom filename
* @return object Genealogy_Gedcom the new Genealogy_Gedcom object
$this->_GedcomFile = $filename;
* return the number of individual
return count($this->_GedcomIndividualsTree);
* return the number of family
return count($this->_GedcomFamiliesTree);
* return the number of object
return count($this->_GedcomObjectsTree);
return $this->GedcomHeaderTreeObject->Date;
* Get an Individual (object) from an identifier
* @param string Indentifier
* @return mixed object or boolean (error)
foreach ($this->GedcomIndividualsTreeObjects as $obj) {
if ($obj->Identifier == $identifier) {
* Get a family (object) from an identifier
* @param string Indentifier
* @return mixed object or boolean (error)
foreach ($this->GedcomFamiliesTreeObjects as $obj) {
if ($obj->Identifier == $identifier) {
* Get an object (object) from an identifier
* @param string Indentifier
* @return mixed object or boolean (error)
foreach ($this->GedcomObjectsTreeObjects as $obj) {
if ($obj->Identifier == $identifier) {
* test if an individual exists
* @param string Indentifier
foreach ($this->GedcomIndividualsTreeObjects as $obj) {
if ($obj->Identifier == $identifier) {
* test if a family exists
* @param string Indentifier
foreach ($this->GedcomFamiliesTreeObjects as $obj) {
if ($obj->Identifier == $identifier) {
* test if an object exists
* @param string Indentifier
foreach ($this->GedcomObjectsTreeObjects as $obj) {
if ($obj->Identifier == $identifier) {
Documentation generated on Mon, 11 Mar 2019 14:18:34 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|