예제 #1
0
function AddParents($family, $person)
{
    $fatherID = "P" . (MaxPersonNumber($family) + 1);
    $motherID = "P" . (MaxPersonNumber($family) + 2);
    $newFamily = new XElement("\n        <Family>\n            <ParentID>{$fatherID}</ParentID>\n            <ParentID>{$motherID}</ParentID>\n            <ChildID>{$person->getAttribute('id')}</ChildID>\n        </Family>\n    ");
    $family->AppendChild(CreateParent("Male", $fatherID));
    $family->AppendChild(CreateParent("Female", $motherID));
    $family->AppendChild($newFamily);
}
예제 #2
0
function NextPersonID($family)
{
    return "P" . (MaxPersonNumber($family) + 1);
}