Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
87.14% covered (warning)
87.14%
61 / 70
93.02% covered (success)
93.02%
40 / 43
CRAP
0.00% covered (danger)
0.00%
0 / 1
Kontakt
87.14% covered (warning)
87.14%
61 / 70
93.02% covered (success)
93.02%
40 / 43
49.30
0.00% covered (danger)
0.00%
0 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 __toString
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
2
 getAdresse
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setAdresse
75.00% covered (warning)
75.00%
3 / 4
0.00% covered (danger)
0.00%
0 / 1
2.06
 getAnlass
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setAnlass
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getArt
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setArt
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getAuftrag
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setAuftrag
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getBemerkung
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setBemerkung
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getDatum
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setDatum
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
6
 getDauer
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setDauer
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getDokument
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setDokument
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getEingangausgang
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setEingangausgang
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getEmail
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setEmail
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getFreifeld1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setFreifeld1
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getFreifeld2
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setFreifeld2
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getKontaktart
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setKontaktart
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getKontaktmit
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setKontaktmit
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getLfdnr
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getMitarbeiter
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setMitarbeiter
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getName
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setName
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getPrioritaet
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setPrioritaet
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getTelereporterprotokoll
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setTelereporterprotokoll
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 isErledigt
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 isMarkiert
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setErledigt
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 setMarkiert
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Satag\AmicronEntityBundle\Entity;
6
7use Doctrine\DBAL\Types\Types;
8use Doctrine\ORM\Mapping as ORM;
9use Satag\AmicronEntityBundle\Traits\BlameableEntity;
10use Satag\AmicronEntityBundle\Traits\BlameableEntityInterface;
11use Satag\AmicronEntityBundle\Traits\DecimalEntity;
12use Satag\AmicronEntityBundle\Traits\VorlegbareEntity;
13use Symfony\Component\Validator\Constraints as Assert;
14
15/**
16 * @see \Satag\AmicronEntityBundle\Tests\Entity\KontaktTest
17 */
18#[ORM\Entity]
19#[ORM\HasLifecycleCallbacks]
20#[ORM\Table(name: 'KONTAKTE')]
21#[ORM\Index(columns: ['vorlageam'], name: 'KONTAKTE_VORLAGEAM_DIDX')]
22#[ORM\Index(columns: ['adressenlfdnr'], name: 'KONTAKTE_ADRESSENLFDNR_FK')]
23#[ORM\Index(columns: ['auftraglfdnr'], name: 'KONTAKTE_AUFTRAGLFDNR_FK')]
24class Kontakt implements BlameableEntityInterface, \Stringable
25{
26    use BlameableEntity;
27    use DecimalEntity;
28    use VorlegbareEntity;
29
30    final public const string ART_KUNDE = 'K';
31    final public const string ART_LIEFERANT = 'L';
32    final public const string ART_MITARBEITER = 'M';
33    final public const string AUSGANG = 'A';
34    final public const string EINGANG = 'E';
35    final public const string INTERN = 'I';
36    final public const int PRIO_HOCH = 1;
37    final public const int PRIO_NIEDRIG = 3;
38    final public const int PRIO_NORMAL = 2;
39
40    #[ORM\ManyToOne(targetEntity: Adresse::class, cascade: ['Persist'])]
41    #[ORM\JoinColumn(name: 'adressenlfdnr', referencedColumnName: 'lfdnr')]
42    private ?Adresse $adresse = null;
43
44    #[ORM\Column(name: 'anlass', type: Types::STRING, length: 60, nullable: true)]
45    private ?string $anlass = null;
46
47    #[ORM\Column(name: 'art', type: Types::STRING, length: 1, nullable: true)]
48    #[Assert\Choice(['K', 'L', 'M'], message: 'Use one of Kontakt::ART_* Constants')]
49    private ?string $art = null;
50
51    #[ORM\ManyToOne(targetEntity: Auftrag::class, cascade: ['Persist'])]
52    #[ORM\JoinColumn(name: 'auftraglfdnr', referencedColumnName: 'lfdnr')]
53    private ?Auftrag $auftrag = null;
54
55    #[ORM\Column(name: 'bemerkung', type: Types::TEXT, nullable: true)]
56    private ?string $bemerkung = null;
57
58    #[ORM\Column(name: 'datum', type: Types::DATETIME_IMMUTABLE, nullable: true)]
59    private ?\DateTimeImmutable $datum = null;
60
61    #[ORM\Column(name: 'dauer', type: 'amicron_decimal', precision: 15, scale: 6, nullable: true)]
62    private ?string $dauer = null;
63
64    #[ORM\ManyToOne(targetEntity: Dokument::class, cascade: ['Persist'])]
65    #[ORM\JoinColumn(name: 'dokumentlfdnr', referencedColumnName: 'lfdnr')]
66    private ?Dokument $dokument = null;
67
68    #[ORM\Column(name: 'eingangausgang', type: Types::STRING, length: 1, nullable: true)]
69    #[Assert\Choice([null, 'E', 'A', 'I'], message: 'Use one of Kontakt::EINGANG, Kontakt::INTERN, Kontakt::AUSGANG Constants')]
70    private ?string $eingangausgang = null;
71
72    #[ORM\ManyToOne(targetEntity: Email::class, cascade: ['Persist'])]
73    #[ORM\JoinColumn(name: 'emaillfdnr', referencedColumnName: 'lfdnr')]
74    private ?Email $email = null;
75
76    #[ORM\Column(name: 'erledigt', type: Types::BOOLEAN, length: 1, nullable: true)]
77    private ?bool $erledigt = null;
78
79    #[ORM\Column(name: 'freifeld1', type: Types::STRING, length: 255, nullable: true)]
80    private ?string $freifeld1 = null;
81
82    #[ORM\Column(name: 'freifeld2', type: Types::STRING, length: 255, nullable: true)]
83    private ?string $freifeld2 = null;
84
85    #[ORM\Column(name: 'kontaktart', type: Types::STRING, length: 20, nullable: true)]
86    private ?string $kontaktart = null;
87
88    #[ORM\Column(name: 'kontaktmit', type: Types::STRING, length: 80, nullable: true)]
89    private ?string $kontaktmit = null;
90
91    #[ORM\Column(name: 'lfdnr', type: Types::INTEGER, nullable: false)]
92    #[ORM\Id]
93    #[ORM\GeneratedValue(strategy: 'SEQUENCE')]
94    #[ORM\SequenceGenerator(sequenceName: 'GEN_LFDNR', allocationSize: 1, initialValue: 1)]
95    public private(set) ?int $lfdnr = null;
96
97    #[ORM\Column(name: 'mark', type: Types::BOOLEAN, length: 1, nullable: true)]
98    private ?bool $markiert = null;
99
100    #[ORM\Column(name: 'mitarbeiter', type: Types::STRING, length: 3, nullable: true)]
101    private ?string $mitarbeiter = null;
102
103    #[ORM\Column(name: 'name', type: Types::STRING, length: 60, nullable: true)]
104    private ?string $name = null;
105
106    #[ORM\Column(name: 'prioritaet', type: Types::INTEGER, nullable: true)]
107    #[Assert\Choice([1, 2, 3], message: 'Use one of Kontakt::PRIO_* Constants')]
108    private ?int $prioritaet = null;
109
110    #[ORM\ManyToOne(targetEntity: Telereporterprotokoll::class, cascade: ['Persist'])]
111    #[ORM\JoinColumn(name: 'trpprotokolllfdnr', referencedColumnName: 'lfdnr')]
112    private ?Telereporterprotokoll $telereporterprotokoll = null;
113
114    public function __construct(
115    ) {
116        $this->setMarkiert(false);
117    }
118
119    public function __toString(): string
120    {
121        return \sprintf(
122            '\\\\contact:%s',
123            $this->lfdnr
124        );
125    }
126
127    public function getAdresse(): ?Adresse
128    {
129        return $this->adresse;
130    }
131
132    public function setAdresse(?Adresse $adresse): self
133    {
134        $this->adresse = $adresse;
135        if ($adresse) {
136            $this->art = $adresse->getArt();
137        }
138
139        return $this;
140    }
141
142    public function getAnlass(): ?string
143    {
144        return $this->anlass;
145    }
146
147    public function setAnlass(?string $anlass): self
148    {
149        $this->anlass = $anlass;
150
151        return $this;
152    }
153
154    public function getArt(): ?string
155    {
156        return $this->art;
157    }
158
159    public function setArt(?string $art): self
160    {
161        $this->art = $art;
162
163        return $this;
164    }
165
166    public function getAuftrag(): ?Auftrag
167    {
168        return $this->auftrag;
169    }
170
171    public function setAuftrag(?Auftrag $auftrag): self
172    {
173        $this->auftrag = $auftrag;
174
175        return $this;
176    }
177
178    public function getBemerkung(): ?string
179    {
180        return $this->bemerkung;
181    }
182
183    public function setBemerkung(?string $bemerkung): self
184    {
185        $this->bemerkung = $bemerkung;
186
187        return $this;
188    }
189
190    public function getDatum(): ?\DateTimeImmutable
191    {
192        return $this->datum;
193    }
194
195    public function setDatum(\DateTimeImmutable|\DateTime|null $datum = null): self
196    {
197        $this->datum = $datum instanceof \DateTime
198            ? \DateTimeImmutable::createFromMutable($datum)
199            : $datum;
200
201        return $this;
202    }
203
204    public function getDauer(): ?string
205    {
206        return $this->dauer;
207    }
208
209    public function setDauer(?string $dauer): self
210    {
211        $this->dauer = $dauer;
212
213        return $this;
214    }
215
216    /**
217     * @return Dokument|null ;
218     */
219    public function getDokument(): ?Dokument
220    {
221        return $this->dokument;
222    }
223
224    public function setDokument(?Dokument $dokument): self
225    {
226        $this->dokument = $dokument;
227
228        return $this;
229    }
230
231    public function getEingangausgang(): ?string
232    {
233        return $this->eingangausgang;
234    }
235
236    public function setEingangausgang(?string $eingangausgang): self
237    {
238        $this->eingangausgang = $eingangausgang;
239
240        return $this;
241    }
242
243    public function getEmail(): ?Email
244    {
245        return $this->email;
246    }
247
248    public function setEmail(?Email $email): self
249    {
250        $this->email = $email;
251
252        return $this;
253    }
254
255    public function getFreifeld1(): ?string
256    {
257        return $this->freifeld1;
258    }
259
260    public function setFreifeld1(?string $freifeld1): self
261    {
262        $this->freifeld1 = $freifeld1;
263
264        return $this;
265    }
266
267    public function getFreifeld2(): ?string
268    {
269        return $this->freifeld2;
270    }
271
272    public function setFreifeld2(?string $freifeld2): self
273    {
274        $this->freifeld2 = $freifeld2;
275
276        return $this;
277    }
278
279    public function getKontaktart(): ?string
280    {
281        return $this->kontaktart;
282    }
283
284    public function setKontaktart(?string $kontaktart): self
285    {
286        $this->kontaktart = $kontaktart;
287
288        return $this;
289    }
290
291    public function getKontaktmit(): ?string
292    {
293        return $this->kontaktmit;
294    }
295
296    public function setKontaktmit(?string $kontaktmit): self
297    {
298        $this->kontaktmit = $kontaktmit;
299
300        return $this;
301    }
302
303    public function getLfdnr(): ?int
304    {
305        return $this->lfdnr;
306    }
307
308    public function getMitarbeiter(): ?string
309    {
310        return $this->mitarbeiter;
311    }
312
313    public function setMitarbeiter(?string $mitarbeiter): self
314    {
315        $this->mitarbeiter = $mitarbeiter;
316
317        return $this;
318    }
319
320    public function getName(): ?string
321    {
322        return $this->name;
323    }
324
325    public function setName(?string $name): self
326    {
327        $this->name = $name;
328
329        return $this;
330    }
331
332    public function getPrioritaet(): ?int
333    {
334        return $this->prioritaet;
335    }
336
337    public function setPrioritaet(?int $prioritaet): self
338    {
339        $this->prioritaet = $prioritaet;
340
341        return $this;
342    }
343
344    public function getTelereporterprotokoll(): ?Telereporterprotokoll
345    {
346        return $this->telereporterprotokoll;
347    }
348
349    public function setTelereporterprotokoll(?Telereporterprotokoll $telereporterprotokoll): self
350    {
351        $this->telereporterprotokoll = $telereporterprotokoll;
352
353        return $this;
354    }
355
356    public function isErledigt(): ?bool
357    {
358        return $this->erledigt;
359    }
360
361    public function isMarkiert(): ?bool
362    {
363        return $this->markiert;
364    }
365
366    public function setErledigt(?bool $erledigt): self
367    {
368        $this->erledigt = $erledigt;
369
370        return $this;
371    }
372
373    public function setMarkiert(bool $markiert): self
374    {
375        $this->markiert = $markiert;
376
377        return $this;
378    }
379}