ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
DomainService.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27
32{
36
37 public function __construct(
41 ) {
42 $this->repo_service = $repo_service;
43 $this->data_service = $data_service;
44 $this->domain_service = $domain_service;
45 }
46
47 public function checkRefId(int $ref_id): void
48 {
50 if (\ilObject::_lookupType($obj_id) !== "wiki") {
51 throw new \ilWikiException("Not a wiki ref id (" . $ref_id . ").");
52 }
53 }
54
55 public function getObjId(int $ref_id): int
56 {
57 return \ilObject::_lookupObjId($ref_id);
58 }
59
60 public function object(
61 int $ref_id
62 ): \ilObjWiki {
63 $this->checkRefId($ref_id);
64 return new \ilObjWiki($ref_id);
65 }
66
67 public function translation(int $ref_id): Translations
68 {
69 return $this->object($ref_id)->getObjectProperties()->getPropertyTranslations();
70 }
71
72 public function getStartingPageId(int $wiki_ref_id): ?int
73 {
74 $pm = $this->domain_service->page()->page($wiki_ref_id);
75 $wiki = $this->object($wiki_ref_id);
76 $start_page = $wiki->getStartPage();
77 if ($start_page === "") {
78 return null;
79 }
80 return $pm->getPageIdForTitle($start_page);
81 }
82
83}
Repository internal data service.
Repository internal repo service.
Class handles translation mode for an object.
InternalDataService $data_service
__construct(InternalDataService $data_service, InternalRepoService $repo_service, InternalDomainService $domain_service)
getStartingPageId(int $wiki_ref_id)
InternalRepoService $repo_service
InternalDomainService $domain_service
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupType(int $id, bool $reference=false)
static _lookupObjId(int $ref_id)
$ref_id
Definition: ltiauth.php:66