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