Format an individual in a list.

@param Individual $person
@param int        $generations

@return string
761726
public function getPersonLi(Individual $person, $generations = 0): string
    {
        $icon     = $generations > 0 ? 'icon-minus' : 'icon-plus';
        $lifespan = $person->canShow() ? '(' . $person->getLifeSpan() . ')' : '';
        $spouses  = $generations > 0 ? $this->loadSpouses($person, 0) : '';

        return
            '<li class="sb_desc_indi_li">' .
            '<a class="sb_desc_indi" href="' . e(route('module', [
                'module' => $this->name(),
                'action' => 'Descendants',
                'ged'    => $person->tree()->name(),
                'xref'   => $person->xref(),
            ])) . '">' .
            '<i class="plusminus ' . $icon . '"></i>' .
            $person->getSexImage() . $person->fullName() . $lifespan .
            '</a>' .
            '<a href="' . e($person->url()) . '" title="' . strip_tags($person->fullName()) . '">' . view('icons/individual') . '</a>' .
            '<div>' . $spouses . '</div>' .
            '</li>';
    }
473487
public function run(Generator $generator): string
    {
        return str_replace(
            $this->call,
            $generator->format($this->formatter, $this->parseArguments()),
            $this->definition
        );
    }
891934
public function formatInherited(array $parents)
    {
        $privileges = array_keys($this->getInheritedPrivileges($parents));
        return $this->formatPrivileges($privileges);
    }
419361
public function generate(Individual $individual, Individual $head): string
    {
        foreach ($individual->spouseFamilies() as $family) {
            foreach ($family->facts(['MARR']) as $fact) {
                $marriage_jd = $fact->date()->julianDay();
                $census_jd   = $this->date()->julianDay();
                if ($marriage_jd <= $census_jd && $marriage_jd >= $census_jd - 365) {
                    // Use the GEDCOM month, as we need this in English - for the US census
                    return ucfirst(strtolower($fact->date()->minimumDate()->format('%O')));
                }
            }
        }

        return '';
    }
1282960
public function chartUrl(Individual $individual, array $parameters = []): string
    {
        return route('module', [
                'module'  => $this->name(),
                'action'  => 'Chart',
                'xrefs[]' => $individual->xref(),
                'ged'     => $individual->tree()->name(),
            ] + $parameters);
    }
922438
public function generate(Individual $individual, Individual $head): string
    {
        foreach ($individual->getAllNames() as $name) {
            return $name['givn'];
        }

        return '';
    }
238011
public function generate(Individual $individual, Individual $head): string
    {
        foreach ($individual->getAllNames() as $name) {
            $given = $name['givn'];
            $space_pos = strpos($given, ' ');

            if ($space_pos === false) {
                return $given;
            }

            return substr($given, 0, $space_pos + 2);
        }

        return '';
    }
701913
public function generate(Individual $individual, Individual $head): string
    {
        $father = $this->father($individual);

        if ($father) {
            return $this->notCountry($father->getBirthPlace()->gedcomName());
        }

        return '';
    }
82866
public function generate(Individual $individual, Individual $head): string
    {
        return $this->lastPartOfPlace(parent::generate($individual, $head));
    }
1167494
protected function closeFamily(Individual $individual): array
    {
        $xrefs = [];

        foreach ($individual->spouseFamilies() as $family) {
            foreach ($family->children() as $child) {
                $xrefs[] = $child->xref();
            }

            foreach ($family->spouses() as $spouse) {
                $xrefs[] = $spouse->xref();
            }
        }

        foreach ($individual->childFamilies() as $family) {
            foreach ($family->children() as $child) {
                $xrefs[] = $child->xref();
            }

            foreach ($family->spouses() as $spouse) {
                $xrefs[] = $spouse->xref();
            }
        }

        return $xrefs;
    }
1371833
public function getDifferentSosaCountUpToGeneration($gen){
        if(!$this->is_setup) return 0;
        return Database::prepare(
            'SELECT COUNT(DISTINCT majs_i_id) FROM `##maj_sosa`' .
            ' WHERE majs_gedcom_id=:tree_id AND majs_user_id=:user_id'.
            ' AND majs_gen <= :gen')
        ->execute(array(
                'tree_id' => $this->tree->getTreeId(), 
                'user_id' => $this->user->getUserId(),
                'gen' => $gen 
        ))->fetchOne() ?: 0;
    }
672126
public function generate(Individual $individual, Individual $head): string
    {
        foreach ($individual->spouseFamilies() as $family) {
            foreach ($family->facts(['MARR']) as $fact) {
                $marriage_jd = $fact->date()->julianDay();
                $census_jd   = $this->date()->julianDay();
                if ($marriage_jd <= $census_jd && $marriage_jd >= $census_jd - 365) {
                    return 'Y';
                }
            }
        }

        return '';
    }
435510
public function mother(Individual $individual): ?Individual
    {
        $family = $individual->primaryChildFamily();

        if ($family) {
            return $family->wife();
        }

        return null;
    }
503640
public function generate(Individual $individual, Individual $head): string
    {
        switch ($individual->sex()) {
            case 'M':
                return $this->male;
            case 'F':
                return $this->female;
            default:
                return '';
        }
    }
992177
private function getPersonalFacts(Individual $individual): Collection
    {
        $facts = $individual->facts();

        foreach ($individual->spouseFamilies() as $family) {
            $facts = $facts->merge($family->facts());
            // Add birth of children from this family to the facts array
            foreach ($family->children() as $child) {
                $childsBirth = $child->facts(['BIRT'])->first();
                if ($childsBirth && $childsBirth->place()->gedcomName() !== '') {
                    $facts->push($childsBirth);
                }
            }
        }

        $facts = Fact::sortFacts($facts);

        return $facts->filter(static function (Fact $item): bool {
            return $item->place()->gedcomName() !== '';
        });
    }
349357
private function _toFormatTree($list, $level = 0)
    {
        $formatTree = [];
        foreach ($list as $val) {
            $tmp_str = str_repeat($this->tabSize, $level);
            $tmp_str .= "└&nbsp;";
            
            $val['level'] = intval($level);
            $val[$this->showTitleField] = $level == 0 ? $val[$this->showTitleField] : $tmp_str . $val[$this->showTitleField];
            if (!array_key_exists('_child', $val)) {
                array_push($formatTree, $val);
            } else {
                $tmp_ary = $val['_child'];
                unset($val['_child']);
                array_push($formatTree, $val);
                $formatTree = array_merge($formatTree, $this->_toFormatTree($tmp_ary, $level + 1));
            }
        }
        
        return $formatTree;
    }
889201
public function format(Collection $record)
    {
        return json_encode($this->prepare($record), ($this->prettyPrint ? JSON_PRETTY_PRINT : 0));
    }