ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.DomainService.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Notes;
22
28{
31
32 public function __construct(
33 InternalDomainService $internal_domain
34 ) {
35 $this->internal_domain = $internal_domain;
36 $this->notes_manager = $internal_domain->notes();
37 }
38
39 public function getNrOfNotesForContext(
41 bool $incl_sub = false,
42 ?int $author = null
43 ): int {
44 if (is_null($author)) {
45 $author = $this->internal_domain->user()->getId();
46 }
47 return $this->notes_manager->getNrOfNotesForContext(
50 $incl_sub,
51 $author
52 );
53 }
54
57 bool $incl_sub = false
58 ): int {
59 return $this->notes_manager->getNrOfNotesForContext(
61 Note::PUBLIC,
62 $incl_sub
63 );
64 }
65
69 public function getById(
70 int $id
71 ): Note {
72 return $this->notes_manager->getById($id);
73 }
74
80 public function getAllCommentsForObjId(
81 int $obj_id,
82 string $since = ""
83 ): array {
84 return $this->notes_manager->getNotesForRepositoryObjId(
85 $obj_id,
86 Note::PUBLIC,
87 false,
88 0,
89 false,
90 $since
91 );
92 }
93
97 public function commentsActive(
98 int $obj_id
99 ): bool {
100 return $this->notes_manager->commentsActive($obj_id);
101 }
102
103 public function activateComments(
104 int $obj_id,
105 bool $a_activate = true
106 ): void {
107 $this->notes_manager->activateComments($obj_id, $a_activate);
108 }
109
113 public function getUserCount(
114 int $obj_id,
115 int $sub_obj_id,
116 string $obj_type
117 ): int {
118 return $this->notes_manager->getUserCount($obj_id, $sub_obj_id, $obj_type);
119 }
120}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
commentsActive(int $obj_id)
Are comments activated for object?
getUserCount(int $obj_id, int $sub_obj_id, string $obj_type)
How many users have attached a note/comment to a given object?
getNrOfCommentsForContext(Context $context, bool $incl_sub=false)
getAllCommentsForObjId(int $obj_id, string $since="")
Gets all comments of a repo object, incl.
getNrOfNotesForContext(Context $context, bool $incl_sub=false, ?int $author=null)
activateComments(int $obj_id, bool $a_activate=true)
InternalDomainService $internal_domain
__construct(InternalDomainService $internal_domain)
getById(int $id)
Get note by id.
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(!file_exists('../ilias.ini.php'))
$context
Definition: webdav.php:31