Lines Matching refs:tree

61      * @param Tree                 $tree
68 public function getBlock(Tree $tree, int $block_id, string $context, array $config = []): string argument
72 'can_edit' => Auth::isManager($tree),
73 'favorites' => $this->getFavorites($tree),
75 'tree' => $tree,
125 * @param Tree $tree
129 public function getFavorites(Tree $tree): array argument
132 ->where('gedcom_id', '=', $tree->id())
135 ->map(static function (object $row) use ($tree): object {
137 $row->record = Registry::gedcomRecordFactory()->make($row->xref, $tree);
159 $tree = Validator::attributes($request)->tree();
166 $record = $this->getRecordForType($type, $xref, $tree);
168 if (Auth::isManager($tree, $user)) {
170 $this->addUrlFavorite($tree, $url, $title ?: $url, $note);
174 $this->addRecordFavorite($tree, $record, $note);
178 $url = route(TreePage::class, ['tree' => $tree->name()]);
190 $tree = Validator::attributes($request)->tree();
194 if (Auth::isManager($tree, $user)) {
201 $url = route(TreePage::class, ['tree' => $tree->name()]);
207 * @param Tree $tree
214 private function addUrlFavorite(Tree $tree, string $url, string $title, string $note): void argument
217 'gedcom_id' => $tree->id(),
228 * @param Tree $tree
234 private function addRecordFavorite(Tree $tree, GedcomRecord $record, string $note): void argument
237 'gedcom_id' => $tree->id(),
246 private function getRecordForType(string $type, string $xref, Tree $tree): GedcomRecord|null argument
250 return Registry::individualFactory()->make($xref, $tree);
253 return Registry::familyFactory()->make($xref, $tree);
256 return Registry::sourceFactory()->make($xref, $tree);
259 return Registry::repositoryFactory()->make($xref, $tree);
262 return Registry::mediaFactory()->make($xref, $tree);