ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ImportantPageManager.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Wiki\Navigation;
22
26
31{
32 protected int $wiki_ref_id;
33 protected \ILIAS\Wiki\Wiki\DomainService $wiki_domain;
34 protected \ILIAS\Wiki\Navigation\ImportantPageDBRepository $imp_page_repo;
35 protected $ref_id;
37
38 public function __construct(
42 int $ref_id
43 ) {
44 $this->wiki_ref_id = $ref_id;
45 $this->data_service = $data_service;
46 $this->imp_page_repo = $imp_page_repo;
47 $this->wiki_domain = $wiki_domain;
48 }
49
50 protected function getWikiId(): int
51 {
52 return $this->wiki_domain->getObjId($this->wiki_ref_id);
53 }
54
58 public function getList(): \Iterator
59 {
60 return $this->imp_page_repo->getList($this->getWikiId());
61 }
62
66 public function getListAsArray(): array
67 {
68 return $this->imp_page_repo->getListAsArray($this->getWikiId());
69 }
70
71 public function add(
72 int $page_id,
73 int $nr = 0,
74 int $indent = 0
75 ): void {
76 $this->imp_page_repo->add(
77 $this->getWikiId(),
78 $page_id,
79 $nr,
80 $indent
81 );
82 }
83
84 public function isImportantPage(
85 int $page_id
86 ): bool {
87 return $this->imp_page_repo->isImportantPage($this->getWikiId(), $page_id);
88 }
89
90 public function removeImportantPage(
91 int $page_id
92 ): void {
93 $this->imp_page_repo->removeImportantPage($this->getWikiId(), $page_id);
94 }
95
97 array $ord,
98 array $indent
99 ): bool {
100 return $this->imp_page_repo->saveOrderingAndIndentation(
101 $this->getWikiId(),
102 $ord,
103 $indent
104 );
105 }
106
107 public function cloneTo(int $new_wiki_obj_id, array $page_id_map): void
108 {
109 foreach ($this->getList() as $ip) {
110 $this->imp_page_repo->add(
111 $new_wiki_obj_id,
112 $page_id_map[$ip->getId()],
113 $ip->getOrder(),
114 $ip->getIndent()
115 );
116 }
117 }
118
122 public function getImportantPageIds(): array
123 {
124 return $this->imp_page_repo->getImportantPageIds($this->getWikiId());
125 }
126
127}
Repository internal data service.
Repository internal repo service.
ILIAS Wiki Navigation ImportantPageDBRepository $imp_page_repo
cloneTo(int $new_wiki_obj_id, array $page_id_map)
saveOrderingAndIndentation(array $ord, array $indent)
__construct(InternalDataService $data_service, ImportantPageDBRepository $imp_page_repo, \ILIAS\Wiki\Wiki\DomainService $wiki_domain, int $ref_id)
add(int $page_id, int $nr=0, int $indent=0)
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.