A main menu item for this chart.

@param Individual $individual

@return Menu
971219
public function chartMenu(Individual $individual): Menu
    {
        return new Menu(
            $this->title(),
            $this->chartUrl($individual),
            $this->chartMenuClass(),
            $this->chartUrlAttributes()
        );
    }
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 '';
    }
497225
public static function getCloseRelationshipName(Individual $individual1, Individual $individual2): string
    {
        if ($individual1 === $individual2) {
            return self::reflexivePronoun($individual1);
        }

        try {
            $relationship = self::getRelationship($individual1, $individual2);

            return self::getRelationshipName($relationship);
        } catch (Exception $ex) {
            return '';
        }
    }
678163
public function generate(Individual $individual, Individual $head): string
    {
        if ($individual->sex() === 'M') {
            return '';
        }

        return (string) Date::getAgeYears($individual->getEstimatedBirthDate(), $this->date());
    }
226126
public function generate(Individual $individual, Individual $head): string
    {
        $birth_place  = (string) $individual->getBirthPlace()->lastParts(1)->first();
        $census_place = $this->place();

        if ($birth_place === 'Wales') {
            $birth_place = 'England';
        }

        if ($census_place === 'Wales') {
            $census_place = 'England';
        }

        if ($birth_place === $census_place || $birth_place === '') {
            return '';
        }

        if ($birth_place === 'England' || $birth_place === 'Scotland' || $birth_place === 'Ireland') {
            return substr($birth_place, 0, 1);
        }

        return 'F';
    }
493383
public function getReportMenu(Individual $individual): Menu
    {
        return new Menu(
            $this->title(),
            route('report-setup', [
                'xref'   => $individual->xref(),
                'ged'    => $individual->tree()->name(),
                'report' => $this->name(),
            ]),
            'menu-report-' . $this->name(),
            ['rel' => 'nofollow']
        );
    }
697746
public function generate(Individual $individual, Individual $head): string
    {
        $birth_place  = $individual->getBirthPlace()->gedcomName();
        $census_place = $this->place();

        // Ignore the census country
        if ($birth_place === $census_place) {
            return '';
        }

        if (substr($birth_place, -strlen($census_place) - 2) === ', ' . $census_place) {
            return substr($birth_place, 0, -strlen($census_place) - 2);
        }

        return $birth_place;
    }
740816
public function generate(Individual $individual, Individual $head): string
    {
        $place = $individual->getBirthPlace()->gedcomName();

        // No birthplace?  Assume born in the same country.
        if ($place === '') {
            $place = $this->place();
        }

        // Did we emigrate or naturalise?
        foreach ($individual->facts(['IMMI' ,'EMIG', 'NATU'], true) as $fact) {
            if (Date::compare($fact->date(), $this->date()) <= 0) {
                $place = $fact->place()->gedcomName();
            }
        }

        $place = $this->lastPartOfPlace($place);

        return self::NATIONALITIES[$place] ?? $place;
    }
686476
public function descendants(Individual $individual, int $generations): Collection
    {
        $descendants = new Collection([$individual]);

        if ($generations > 0) {
            foreach ($individual->spouseFamilies() as $family) {
                foreach ($family->children() as $child) {
                    $descendants = $descendants->merge($this->descendants($child, $generations - 1));
                }
            }
        }

        return $descendants;
    }
788403
public function sosaStradonitzAncestors(Individual $individual, int $generations): Collection
    {
        $ancestors = [1 => $individual];

        $queue = [1];

        $max = 2 ** ($generations - 1);

        while (!empty($queue)) {
            $sosa_stradonitz_number = array_shift($queue);

            if ($sosa_stradonitz_number >= $max) {
                break;
            }

            $family = $ancestors[$sosa_stradonitz_number]->primaryChildFamily();

            if ($family instanceof Family) {
                if ($family->husband() instanceof Individual) {
                    $ancestors[$sosa_stradonitz_number * 2] = $family->husband();
                    $queue[] = $sosa_stradonitz_number * 2;
                }

                if ($family->wife() instanceof Individual) {
                    $ancestors[$sosa_stradonitz_number * 2 + 1] = $family->wife();
                    $queue[] = $sosa_stradonitz_number * 2 + 1;
                }
            }
        }

        return new Collection($ancestors);
    }
656424
protected function createComponentMenu(): Menu
	{
		$moduleMenu = $this->menuFactory->create();
		$moduleMenu->setTranslator($this->translator);
		$moduleMenu->setBaseUrl('cms.title', ":{$this->module}:Homepage:");
		return $moduleMenu;
	}
880517
public function father(Individual $individual): ?Individual
    {
        $family = $individual->primaryChildFamily();

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

        return null;
    }
750367
protected function createComponentPagePrimaryModal() : object
    {
        $control = $this->IPage_PrimaryModal->create();

        $control->onSave[] = function () use ($control)
        {
            $this->getComponent('pageSummaryModal')->redrawControl('pageSummary');
            $this->getComponent('pageUrlModal')->redrawControl('urlSummary');
            $control->redrawControl('primaryForm');
        };

        return $control;
    }
115282
public function addMainMenuItem($owner, $code, array $definition)
    {
        $itemKey = $this->makeItemKey($owner, $code);

        if (isset($this->items[$itemKey])) {
            $definition = array_merge((array) $this->items[$itemKey], $definition);
        }

        $item = (object) array_merge(self::$mainItemDefaults, array_merge($definition, [
            'code'  => $code,
            'owner' => $owner
        ]));

        $this->items[$itemKey] = $item;

        if ($item->sideMenu) {
            $this->addSideMenuItems($owner, $code, $item->sideMenu);
        }
    }
1245051
public function generate(Individual $individual, Individual $head): string
    {
        foreach ($individual->facts(['OCCU']) as $fact) {
            return $fact->value();
        }

        return '';
    }
609580
public function historicEventsForIndividual(Individual $individual): Collection
    {
        $min_date = $individual->getEstimatedBirthDate();
        $max_date = $individual->getEstimatedDeathDate();

        return (new Collection($this->historicEventsAll()))
            ->map(static function (string $gedcom) use ($individual): Fact {
                return new Fact($gedcom, $individual, 'histo');
            })
            ->filter(static function (Fact $fact) use ($min_date, $max_date): bool {
                return Date::compare($fact->date(), $min_date) >= 0 && Date::compare($fact->date(), $max_date) <= 0;
            });
    }
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 '';
    }