src/Webtrees/Module/Sosa/Model/SosaCalculator.php
protected function addNode(Individual $indi, $sosa) {                
        $birth_year = $indi->getEstimatedBirthDate()->gregorianYear();
        $death_year = $indi->getEstimatedDeathDate()->gregorianYear();
        
        $this->tmp_sosa_table[] = array(
            'indi' => $indi->getXref(), 
            'sosa' => $sosa, 
            'birth_year' => $birth_year,
            'death_year' => $death_year
        );
        
        $this->flushTmpSosaTable();
        
        if($fam = $indi->getPrimaryChildFamily()) {
            if($husb = $fam->getHusband()) $this->addNode($husb, 2 * $sosa);
            if($wife = $fam->getWife()) $this->addNode($wife, 2 * $sosa + 1);
        }
    }
protected function addNode(Individual $indi, $sosa) {                
        $birth_year = $indi->getEstimatedBirthDate()->gregorianYear();
        $death_year = $indi->getEstimatedDeathDate()->gregorianYear();
        
        $this->tmp_sosa_table[] = array(
            'indi' => $indi->getXref(), 
            'sosa' => $sosa, 
            'birth_year' => $birth_year,
            'death_year' => $death_year
        );
        
        $this->flushTmpSosaTable();
        
        if($fam = $indi->getPrimaryChildFamily()) {
            if($husb = $fam->getHusband()) $this->addNode($husb, 2 * $sosa);
            if($wife = $fam->getWife()) $this->addNode($wife, 2 * $sosa + 1);
        }
    }
protected function addNode ( Individual $ indi , $ sosa ) { $ birth_year = $ indi -> getEstimatedBirthDate ( ) -> gregorianYear ( ) ; $ death_year = $ indi -> getEstimatedDeathDate ( ) -> gregorianYear ( ) ; $ this -> tmp_sosa_table [ ] = array ( 'indi' => $ indi -> getXref ( ) , 'sosa' => $ sosa , 'birth_year' => $ birth_year , 'death_year' => $ death_year ) ; $ this -> flushTmpSosaTable ( ) ; if ( $ fam = $ indi -> getPrimaryChildFamily ( ) ) { if ( $ husb = $ fam -> getHusband ( ) ) $ this -> addNode ( $ husb , 2 * $ sosa ) ; if ( $ wife = $ fam -> getWife ( ) ) $ this -> addNode ( $ wife , 2 * $ sosa + 1 ) ; } }
Recursive method to add individual to the Sosa table, and flush it regularly
@param Individual $indi Individual to add
@param int $sosa Individual's sosa
Recursive method to add individual to the Sosa table and flush it regularly