Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 49 |
|
0.00% |
0 / 35 |
CRAP | |
0.00% |
0 / 1 |
SolvResult | |
0.00% |
0 / 49 |
|
0.00% |
0 / 35 |
1406 | |
0.00% |
0 / 1 |
__toString | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
2 | |||
getId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getPerson | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setPerson | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getEvent | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setEvent | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getClass | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setClass | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getRank | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setRank | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getBirthYear | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setBirthYear | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getDomicile | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setDomicile | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getClub | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setClub | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getResult | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setResult | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getSplits | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setSplits | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getFinishSplit | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setFinishSplit | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getClassDistance | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setClassDistance | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getClassElevation | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setClassElevation | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getClassControlCount | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setClassControlCount | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getClassCompetitorCount | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setClassCompetitorCount | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getFieldValue | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
setFieldValue | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace Olz\Entity; |
4 | |
5 | use Doctrine\ORM\Mapping as ORM; |
6 | use Olz\Repository\SolvResultRepository; |
7 | |
8 | #[ORM\Table(name: 'solv_results')] |
9 | #[ORM\Index(name: 'person_name_index', columns: ['person', 'name'])] |
10 | #[ORM\Index(name: 'event_index', columns: ['event'])] |
11 | #[ORM\Entity(repositoryClass: SolvResultRepository::class)] |
12 | class SolvResult { |
13 | #[ORM\Id] |
14 | #[ORM\Column(type: 'integer', nullable: false)] |
15 | #[ORM\GeneratedValue] |
16 | private int $id; |
17 | |
18 | #[ORM\Column(type: 'integer', nullable: false)] |
19 | private int $person; |
20 | |
21 | #[ORM\Column(type: 'integer', nullable: false)] |
22 | private int $event; |
23 | |
24 | #[ORM\Column(type: 'string', nullable: false, length: 15)] |
25 | private string $class; |
26 | |
27 | #[ORM\Column(type: 'integer', nullable: false)] |
28 | private int $rank; |
29 | |
30 | #[ORM\Column(type: 'string', nullable: false, length: 31)] |
31 | private string $name; |
32 | |
33 | #[ORM\Column(type: 'string', nullable: false, length: 3)] |
34 | private string $birth_year; |
35 | |
36 | #[ORM\Column(type: 'string', nullable: false, length: 31)] |
37 | private string $domicile; |
38 | |
39 | #[ORM\Column(type: 'string', nullable: false, length: 31)] |
40 | private string $club; |
41 | |
42 | #[ORM\Column(type: 'integer', nullable: false)] |
43 | private int $result; |
44 | |
45 | #[ORM\Column(type: 'text', nullable: false)] |
46 | private string $splits; |
47 | |
48 | #[ORM\Column(type: 'integer', nullable: false)] |
49 | private int $finish_split; |
50 | |
51 | #[ORM\Column(type: 'integer', nullable: false)] |
52 | private int $class_distance; |
53 | |
54 | #[ORM\Column(type: 'integer', nullable: false)] |
55 | private int $class_elevation; |
56 | |
57 | #[ORM\Column(type: 'integer', nullable: false)] |
58 | private int $class_control_count; |
59 | |
60 | #[ORM\Column(type: 'integer', nullable: false)] |
61 | private int $class_competitor_count; |
62 | |
63 | public function __toString(): string { |
64 | return <<<ZZZZZZZZZZ |
65 | SolvResult( |
66 | id:{$this->id}, |
67 | event:{$this->event}, |
68 | class:{$this->class}, |
69 | person:{$this->person}, |
70 | name:{$this->name}, |
71 | birth_year:{$this->birth_year}, |
72 | domicile:{$this->domicile}, |
73 | club:{$this->club}, |
74 | ) |
75 | ZZZZZZZZZZ; |
76 | } |
77 | |
78 | /** @var array<string, true> */ |
79 | private array $valid_field_names = [ |
80 | 'id' => true, |
81 | 'person' => true, |
82 | 'event' => true, |
83 | 'class' => true, |
84 | 'rank' => true, |
85 | 'name' => true, |
86 | 'birth_year' => true, |
87 | 'domicile' => true, |
88 | 'club' => true, |
89 | 'result' => true, |
90 | 'splits' => true, |
91 | 'finish_split' => true, |
92 | 'class_distance' => true, |
93 | 'class_elevation' => true, |
94 | 'class_control_count' => true, |
95 | 'class_competitor_count' => true, |
96 | ]; |
97 | // PRIMARY KEY (`id`), |
98 | // UNIQUE KEY `person` (`person`,`event`,`class`,`name`,`birth_year`,`domicile`,`club`) |
99 | |
100 | public function getId(): ?int { |
101 | return $this->id ?? null; |
102 | } |
103 | |
104 | public function setId(int $new_id): void { |
105 | $this->id = $new_id; |
106 | } |
107 | |
108 | public function getPerson(): int { |
109 | return $this->person; |
110 | } |
111 | |
112 | public function setPerson(int $new_person): void { |
113 | $this->person = $new_person; |
114 | } |
115 | |
116 | public function getEvent(): int { |
117 | return $this->event; |
118 | } |
119 | |
120 | public function setEvent(int $new_event): void { |
121 | $this->event = $new_event; |
122 | } |
123 | |
124 | public function getClass(): string { |
125 | return $this->class; |
126 | } |
127 | |
128 | public function setClass(string $new_class): void { |
129 | $this->class = $new_class; |
130 | } |
131 | |
132 | public function getRank(): int { |
133 | return $this->rank; |
134 | } |
135 | |
136 | public function setRank(int $new_rank): void { |
137 | $this->rank = $new_rank; |
138 | } |
139 | |
140 | public function getName(): string { |
141 | return $this->name; |
142 | } |
143 | |
144 | public function setName(string $new_name): void { |
145 | $this->name = $new_name; |
146 | } |
147 | |
148 | public function getBirthYear(): string { |
149 | return $this->birth_year; |
150 | } |
151 | |
152 | public function setBirthYear(string $new_birth_year): void { |
153 | $this->birth_year = $new_birth_year; |
154 | } |
155 | |
156 | public function getDomicile(): string { |
157 | return $this->domicile; |
158 | } |
159 | |
160 | public function setDomicile(string $new_domicile): void { |
161 | $this->domicile = $new_domicile; |
162 | } |
163 | |
164 | public function getClub(): string { |
165 | return $this->club; |
166 | } |
167 | |
168 | public function setClub(string $new_club): void { |
169 | $this->club = $new_club; |
170 | } |
171 | |
172 | public function getResult(): int { |
173 | return $this->result; |
174 | } |
175 | |
176 | public function setResult(int $new_result): void { |
177 | $this->result = $new_result; |
178 | } |
179 | |
180 | public function getSplits(): string { |
181 | return $this->splits; |
182 | } |
183 | |
184 | public function setSplits(string $new_splits): void { |
185 | $this->splits = $new_splits; |
186 | } |
187 | |
188 | public function getFinishSplit(): int { |
189 | return $this->finish_split; |
190 | } |
191 | |
192 | public function setFinishSplit(int $new_finish_split): void { |
193 | $this->finish_split = $new_finish_split; |
194 | } |
195 | |
196 | public function getClassDistance(): int { |
197 | return $this->class_distance; |
198 | } |
199 | |
200 | public function setClassDistance(int $new_class_distance): void { |
201 | $this->class_distance = $new_class_distance; |
202 | } |
203 | |
204 | public function getClassElevation(): int { |
205 | return $this->class_elevation; |
206 | } |
207 | |
208 | public function setClassElevation(int $new_class_elevation): void { |
209 | $this->class_elevation = $new_class_elevation; |
210 | } |
211 | |
212 | public function getClassControlCount(): int { |
213 | return $this->class_control_count; |
214 | } |
215 | |
216 | public function setClassControlCount(int $new_class_control_count): void { |
217 | $this->class_control_count = $new_class_control_count; |
218 | } |
219 | |
220 | public function getClassCompetitorCount(): int { |
221 | return $this->class_competitor_count; |
222 | } |
223 | |
224 | public function setClassCompetitorCount(int $new_class_competitor_count): void { |
225 | $this->class_competitor_count = $new_class_competitor_count; |
226 | } |
227 | |
228 | public function getFieldValue(string $field_name): mixed { |
229 | if (!isset($this->valid_field_names[$field_name])) { |
230 | throw new \Exception("getFieldValue: Invalid field name: {$field_name}", 1); |
231 | } |
232 | return $this->{$field_name}; |
233 | } |
234 | |
235 | public function setFieldValue(string $field_name, mixed $new_field_value): void { |
236 | if (!isset($this->valid_field_names[$field_name])) { |
237 | throw new \Exception("setFieldValue: Invalid field name: {$field_name}", 1); |
238 | } |
239 | $this->{$field_name} = $new_field_value; |
240 | } |
241 | } |