ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.Note.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Notes;
22
26class Note
27{
28 public const PRIVATE = 1;
29 public const PUBLIC = 2;
30 public const MESSAGE = 3;
31
32 protected int $id = 0;
33 protected ?string $update_date;
34 protected ?string $creation_date;
35 protected int $author = 0;
36 protected int $type = 0;
37 protected string $text = "";
38 protected int $recipient = 0;
39 protected Context $context;
40
41 public function __construct(
42 int $id,
44 string $text,
45 int $author,
46 int $type = self::PRIVATE,
47 ?string $creation_date = null,
48 ?string $update_date = null,
49 ?int $recipient = 0
50 ) {
51 $this->id = $id;
52 $this->context = $context;
53 $this->text = $text;
54 $this->author = $author;
55 $this->type = $type;
56 $this->update_date = $update_date;
57 $this->creation_date = $creation_date;
58 $this->recipient = $recipient;
59 }
60
61 public function withCreationDate(string $creation_date): self
62 {
63 $note = clone $this;
64 $note->creation_date = $creation_date;
65 return $note;
66 }
67
68 public function getId(): int
69 {
70 return $this->id;
71 }
72
73 public function getContext(): Context
74 {
75 return $this->context;
76 }
77
78 public function getText(): string
79 {
80 return $this->text;
81 }
82
83 public function getAuthor(): int
84 {
85 return $this->author;
86 }
87
88 public function getType(): int
89 {
90 return $this->type;
91 }
92
93 public function getCreationDate(): ?string
94 {
96 }
97
98 public function getUpdateDate(): ?string
99 {
100 return $this->update_date;
101 }
102
103 public function getRecipient(): int
104 {
105 return $this->recipient;
106 }
107
108}
Context $context
Definition: class.Note.php:39
__construct(int $id, Context $context, string $text, int $author, int $type=self::PRIVATE, ?string $creation_date=null, ?string $update_date=null, ?int $recipient=0)
Definition: class.Note.php:41
string $update_date
Definition: class.Note.php:33
withCreationDate(string $creation_date)
Definition: class.Note.php:61
string $creation_date
Definition: class.Note.php:34
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...