Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
92.31% covered (success)
92.31%
24 / 26
89.47% covered (warning)
89.47%
17 / 19
CRAP
0.00% covered (danger)
0.00%
0 / 1
Lager
92.31% covered (success)
92.31%
24 / 26
89.47% covered (warning)
89.47%
17 / 19
21.20
0.00% covered (danger)
0.00%
0 / 1
 __construct
50.00% covered (danger)
50.00%
1 / 2
0.00% covered (danger)
0.00%
0 / 1
2.50
 __toString
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getAngelegtam
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getAngelegtvon
100.00% covered (success)
100.00%
1 / 1
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
 getGeaendertam
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setGeaendertam
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
2
 getGeaendertvon
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setGeaendertvon
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
 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
 isBestandausblenden
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 isSperrlager
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setAngelegtam
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setAngelegtvon
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setBestandausblenden
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 setSperrlager
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\BlameableEntityInterface;
10
11/**
12 * Hinweis: Nicht mit BlameableEntityTrait nutzbar.
13 *
14 * @see \Satag\AmicronEntityBundle\Tests\Entity\LagerTest
15 */
16#[ORM\Entity]
17#[ORM\HasLifecycleCallbacks]
18#[ORM\Table(name: 'LAGER')]
19#[ORM\UniqueConstraint(name: 'LAGER_UK', columns: ['lager'])]
20class Lager implements BlameableEntityInterface, \Stringable
21{
22    #[ORM\Column(name: 'bemerkung', type: Types::TEXT, nullable: true)]
23    private ?string $bemerkung = null;
24
25    #[ORM\Column(name: 'bestandausblenden', type: 'boolean_int', nullable: true)]
26    private ?bool $bestandausblenden = null;
27
28    #[ORM\Column(name: 'geaendertam', type: Types::DATETIME_IMMUTABLE, nullable: true)]
29    private ?\DateTimeImmutable $geaendertam = null;
30
31    #[ORM\Column(name: 'geaendertvon', type: Types::STRING, length: 3, nullable: true)]
32    private ?string $geaendertvon = null;
33
34    #[ORM\Column(name: 'lfdnr', type: Types::INTEGER, nullable: false)]
35    #[ORM\Id]
36    #[ORM\GeneratedValue(strategy: 'SEQUENCE')]
37    #[ORM\SequenceGenerator(sequenceName: 'GEN_LFDNR', allocationSize: 1, initialValue: 1)]
38    public private(set) ?int $lfdnr = null;
39
40    #[ORM\Column(name: 'lager', type: Types::STRING, length: 30, unique: true, nullable: false)]
41    private string $name;
42
43    #[ORM\Column(name: 'sperrlager', type: 'boolean_int', nullable: true)]
44    private ?bool $sperrlager = null;
45
46    public function __construct(
47        ?string $name = null
48    ) {
49        if ($name !== null) {
50            $this->setName($name);
51        }
52    }
53
54    public function __toString(): string
55    {
56        return \sprintf('%s (%s)', $this->getName(), $this->lfdnr);
57    }
58
59    public function getAngelegtam(): ?\DateTimeImmutable
60    {
61        return $this->geaendertam;
62    }
63
64    public function getAngelegtvon(): ?string
65    {
66        return $this->geaendertvon;
67    }
68
69    public function getBemerkung(): ?string
70    {
71        return $this->bemerkung;
72    }
73
74    public function setBemerkung(?string $bemerkung): self
75    {
76        $this->bemerkung = $bemerkung;
77
78        return $this;
79    }
80
81    public function getGeaendertam(): ?\DateTimeImmutable
82    {
83        return $this->geaendertam;
84    }
85
86    public function setGeaendertam(\DateTimeImmutable|\DateTime|null $dateTime): static
87    {
88        $this->geaendertam = $dateTime instanceof \DateTime ? \DateTimeImmutable::createFromMutable($dateTime) : $dateTime;
89
90        return $this;
91    }
92
93    public function getGeaendertvon(): ?string
94    {
95        return $this->geaendertvon;
96    }
97
98    public function setGeaendertvon(?string $kuerzel): static
99    {
100        $this->geaendertvon = $kuerzel;
101
102        return $this;
103    }
104
105    public function getLfdnr(): ?int
106    {
107        return $this->lfdnr;
108    }
109
110    public function getName(): string
111    {
112        return $this->name;
113    }
114
115    public function setName(string $name): self
116    {
117        $this->name = $name;
118
119        return $this;
120    }
121
122    public function isBestandausblenden(): ?bool
123    {
124        return $this->bestandausblenden;
125    }
126
127    public function isSperrlager(): ?bool
128    {
129        return $this->sperrlager;
130    }
131
132    public function setAngelegtam(\DateTimeImmutable|\DateTime|null $dateTime): static
133    {
134        return $this->setGeaendertam($dateTime);
135    }
136
137    public function setAngelegtvon(?string $kuerzel): static
138    {
139        return $this->setGeaendertvon($kuerzel);
140    }
141
142    public function setBestandausblenden(?bool $bestandausblenden): self
143    {
144        $this->bestandausblenden = $bestandausblenden;
145
146        return $this;
147    }
148
149    public function setSperrlager(?bool $sperrlager): self
150    {
151        $this->sperrlager = $sperrlager;
152
153        return $this;
154    }
155}