Lines Matching refs:individual
92 $individual = Registry::individualFactory()->make($xref, $tree);
93 $individual = Auth::checkIndividualAccess($individual);
96 if ($individual->xref() !== $xref || Registry::slugFactory()->make($individual) !== $slug) {
97 return redirect($individual->url(), StatusCodeInterface::STATUS_MOVED_PERMANENTLY);
102 foreach ($individual->facts(['OBJE']) as $fact) {
114 $users = $this->user_service->findByIndividual($individual);
121 ->map(fn (ModuleShareInterface $module) => $module->share($individual))
125 'age' => $this->ageString($individual),
127 'clipboard_facts' => $this->clipboard_service->pastableFacts($individual),
129 'meta_description' => $this->metaDescription($individual),
131 'record' => $individual,
133 'sidebars' => $this->getSidebars($individual),
134 'tabs' => $this->getTabs($individual),
135 'significant' => $this->significant($individual),
136 'title' => $individual->fullName() . ' ' . $individual->lifespan(),
139 ])->withHeader('Link', '<' . $individual->url() . '>; rel="canonical"');
143 * @param Individual $individual
147 private function ageString(Individual $individual): string argument
149 if ($individual->isDead()) {
151 $age = (string) new Age($individual->getBirthDate(), $individual->getDeathDate());
157 switch ($individual->sex()) {
172 $age = (string) new Age($individual->getBirthDate(), $today);
183 * @param Individual $individual
187 private function metaDescription(Individual $individual): string argument
191 $birth_date = $individual->getBirthDate();
192 $birth_place = $individual->getBirthPlace();
200 $death_date = $individual->getDeathDate();
201 $death_place = $individual->getDeathPlace();
209 foreach ($individual->childFamilies() as $family) {
213 foreach ($individual->spouseFamilies() as $family) {
214 $spouse = $family->spouse($individual);
219 …d_names = $family->children()->map(static fn (Individual $individual): string => e($individual->ge…
236 * @param Individual $individual
240 public function getSidebars(Individual $individual): Collection argument
243 ->findByComponent(ModuleSidebarInterface::class, $individual->tree(), Auth::user())
244 …ter(static fn (ModuleSidebarInterface $sidebar): bool => $sidebar->hasSidebarContent($individual));
251 * @param Individual $individual
255 public function getTabs(Individual $individual): Collection argument
258 ->findByComponent(ModuleTabInterface::class, $individual->tree(), Auth::user())
259 ->filter(static fn (ModuleTabInterface $tab): bool => $tab->hasTabContent($individual));
266 * @param Individual $individual
270 private function significant(Individual $individual): object argument
272 [$surname] = explode(',', $individual->sortName());
274 $family = $individual->childFamilies()->merge($individual->spouseFamilies())->first();
278 'individual' => $individual,