ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.Code.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27class Code
28{
29 protected string $code = "";
30 protected ?string $user_key = null;
31 protected string $email = "";
32 protected string $last_name = "";
33 protected string $first_name = "";
34 protected int $id = 0;
35 protected int $user_id = 0;
36 protected int $survey_id = 0;
37 protected int $tstamp = 0;
38 protected int $sent = 0;
39
40 public function __construct(
41 string $code
42 ) {
43 $this->code = $code;
44 }
45
46 public function getCode(): string
47 {
48 return $this->code;
49 }
50
51 public function getFirstName(): string
52 {
53 return $this->first_name;
54 }
55
56 public function getLastName(): string
57 {
58 return $this->last_name;
59 }
60
61 public function getEmail(): string
62 {
63 return $this->email;
64 }
65
66 public function getUserKey(): string
67 {
68 return $this->user_key;
69 }
70
71 public function getSurveyId(): int
72 {
73 return $this->survey_id;
74 }
75
76 public function getId(): int
77 {
78 return $this->id;
79 }
80
81 public function getUserId(): int
82 {
83 return $this->user_id;
84 }
85
86 public function getSent(): int
87 {
88 return $this->sent;
89 }
90
91 public function getTimestamp(): int
92 {
93 return $this->tstamp;
94 }
95
96 public function withId(int $id): self
97 {
98 $code = clone $this;
99 $code->id = $id;
100 return $code;
101 }
102
103 public function withSurveyId(int $id): self
104 {
105 $code = clone $this;
106 $code->survey_id = $id;
107 return $code;
108 }
109
110 public function withUserKey(string $user_key): self
111 {
112 $code = clone $this;
113 $code->user_key = $user_key;
114 return $code;
115 }
116
117 public function withUserId(int $user_id): self
118 {
119 $code = clone $this;
120 $code->user_id = $user_id;
121 return $code;
122 }
123
124 public function withTimestamp(int $tstamp): self
125 {
126 $code = clone $this;
127 $code->tstamp = $tstamp;
128 return $code;
129 }
130
131 public function withSent(int $sent): self
132 {
133 $code = clone $this;
134 $code->sent = $sent;
135 return $code;
136 }
137
138 public function withEmail(string $email): self
139 {
140 $code = clone $this;
141 $code->email = $email;
142 return $code;
143 }
144
145 public function withFirstName(string $first_name): self
146 {
147 $code = clone $this;
148 $code->first_name = $first_name;
149 return $code;
150 }
151
152 public function withLastName(string $last_name): self
153 {
154 $code = clone $this;
155 $code->last_name = $last_name;
156 return $code;
157 }
158}
Code data class.
Definition: class.Code.php:28
withUserKey(string $user_key)
Definition: class.Code.php:110
withFirstName(string $first_name)
Definition: class.Code.php:145
withLastName(string $last_name)
Definition: class.Code.php:152
__construct(string $code)
Definition: class.Code.php:40
withEmail(string $email)
Definition: class.Code.php:138
withUserId(int $user_id)
Definition: class.Code.php:117
withTimestamp(int $tstamp)
Definition: class.Code.php:124