Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
66.15% |
43 / 65 |
|
83.87% |
26 / 31 |
CRAP | |
0.00% |
0 / 1 |
| Aufgabe | |
66.15% |
43 / 65 |
|
83.87% |
26 / 31 |
97.97 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getAlarmvorlaufzeit | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setAlarmvorlaufzeit | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getAlarmzeit | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setAlarmzeit | |
75.00% |
3 / 4 |
|
0.00% |
0 / 1 |
2.06 | |||
| isAktiv | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setAktiv | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getErledigtam | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setErledigtam | |
75.00% |
3 / 4 |
|
0.00% |
0 / 1 |
2.06 | |||
| getFarbwert | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setFarbwert | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getFortschritt | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setFortschritt | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| isGanztags | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setGanztags | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getSynchid | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setSynchid | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getTerminstatus | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setTerminstatus | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getTermintyp | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setTermintyp | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getVaterlfdnr | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setVaterlfdnr | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getWiederholung | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setWiederholung | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getWiederholunginfo | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setWiederholunginfo | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| setStartzeit | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
12 | |||
| setFaelligAm | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
30 | |||
| getFaelligAm | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| __toString | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Satag\AmicronEntityBundle\Entity; |
| 6 | |
| 7 | use Doctrine\DBAL\Types\Types; |
| 8 | use Doctrine\ORM\Mapping as ORM; |
| 9 | |
| 10 | /** |
| 11 | * @see \Satag\AmicronEntityBundle\Tests\Entity\AufgabeTest |
| 12 | */ |
| 13 | #[ORM\Entity] |
| 14 | #[ORM\HasLifecycleCallbacks] |
| 15 | class Aufgabe extends AbstractAufgabeTermin implements \Stringable |
| 16 | { |
| 17 | final public const int NICHT_BEGONNEN = 0; |
| 18 | final public const int IN_BEARBEITUNG = 1; |
| 19 | final public const int ERLEDIGT = 2; |
| 20 | final public const int WARTEND = 3; |
| 21 | final public const int ZURUECKGESTELLT = 4; |
| 22 | |
| 23 | #[ORM\Column(name: 'alarmvorlaufzeit', type: Types::INTEGER, nullable: true)] |
| 24 | private ?int $alarmvorlaufzeit = null; |
| 25 | |
| 26 | #[ORM\Column(name: 'alarmzeit', type: Types::DATETIME_IMMUTABLE, nullable: true)] |
| 27 | private ?\DateTimeImmutable $alarmzeit = null; |
| 28 | |
| 29 | #[ORM\Column(name: 'aktiv', type: Types::BOOLEAN, length: 1, nullable: true)] |
| 30 | private ?bool $aktiv = null; |
| 31 | |
| 32 | #[ORM\Column(name: 'erledigtam', type: Types::DATETIME_IMMUTABLE, nullable: true)] |
| 33 | private ?\DateTimeImmutable $erledigtam = null; |
| 34 | |
| 35 | #[ORM\Column(name: 'farbwert', type: Types::INTEGER, nullable: true)] |
| 36 | private ?int $farbwert = null; |
| 37 | |
| 38 | #[ORM\Column(name: 'fortschritt', type: Types::INTEGER, nullable: true)] |
| 39 | private ?int $fortschritt = null; |
| 40 | |
| 41 | #[ORM\Column(name: 'ganztags', type: Types::BOOLEAN, length: 1, nullable: true)] |
| 42 | private ?bool $ganztags = null; |
| 43 | |
| 44 | #[ORM\Column(name: 'synchid', type: Types::STRING, length: 255, nullable: true)] |
| 45 | private ?string $synchid = null; |
| 46 | |
| 47 | #[ORM\Column(name: 'terminstatus', type: Types::INTEGER, nullable: true)] |
| 48 | private ?int $terminstatus = null; |
| 49 | |
| 50 | #[ORM\Column(name: 'termintyp', type: Types::INTEGER, nullable: true)] |
| 51 | private ?int $termintyp = null; |
| 52 | |
| 53 | #[ORM\Column(name: 'vaterlfdnr', type: Types::INTEGER, nullable: true)] |
| 54 | private ?int $vaterlfdnr = null; |
| 55 | |
| 56 | #[ORM\Column(name: 'wiederholung', type: Types::INTEGER, nullable: true)] |
| 57 | private ?int $wiederholung = null; |
| 58 | |
| 59 | #[ORM\Column(name: 'wiederholunginfo', type: 'blob_base64', nullable: true)] |
| 60 | private ?string $wiederholunginfo = null; |
| 61 | |
| 62 | public function __construct( |
| 63 | ) { |
| 64 | parent::__construct(); |
| 65 | } |
| 66 | |
| 67 | public function getAlarmvorlaufzeit(): ?int |
| 68 | { |
| 69 | return $this->alarmvorlaufzeit; |
| 70 | } |
| 71 | |
| 72 | public function setAlarmvorlaufzeit(?int $alarmvorlaufzeit): static |
| 73 | { |
| 74 | $this->alarmvorlaufzeit = $alarmvorlaufzeit; |
| 75 | |
| 76 | return $this; |
| 77 | } |
| 78 | |
| 79 | public function getAlarmzeit(): ?\DateTimeImmutable |
| 80 | { |
| 81 | return $this->alarmzeit; |
| 82 | } |
| 83 | |
| 84 | public function setAlarmzeit(\DateTimeImmutable|\DateTime|null $alarmzeit): static |
| 85 | { |
| 86 | $this->alarmzeit = $alarmzeit instanceof \DateTime |
| 87 | ? \DateTimeImmutable::createFromMutable($alarmzeit) |
| 88 | : $alarmzeit; |
| 89 | |
| 90 | return $this; |
| 91 | } |
| 92 | |
| 93 | public function isAktiv(): ?bool |
| 94 | { |
| 95 | return $this->aktiv; |
| 96 | } |
| 97 | |
| 98 | public function setAktiv(?bool $aktiv): static |
| 99 | { |
| 100 | $this->aktiv = $aktiv; |
| 101 | |
| 102 | return $this; |
| 103 | } |
| 104 | |
| 105 | public function getErledigtam(): ?\DateTimeImmutable |
| 106 | { |
| 107 | return $this->erledigtam; |
| 108 | } |
| 109 | |
| 110 | public function setErledigtam(\DateTimeImmutable|\DateTime|null $dateTime): static |
| 111 | { |
| 112 | $this->erledigtam = $dateTime instanceof \DateTime |
| 113 | ? \DateTimeImmutable::createFromMutable($dateTime) |
| 114 | : $dateTime; |
| 115 | |
| 116 | return $this; |
| 117 | } |
| 118 | |
| 119 | public function getFarbwert(): ?int |
| 120 | { |
| 121 | return $this->farbwert; |
| 122 | } |
| 123 | |
| 124 | public function setFarbwert(?int $farbwert): static |
| 125 | { |
| 126 | $this->farbwert = $farbwert; |
| 127 | |
| 128 | return $this; |
| 129 | } |
| 130 | |
| 131 | public function getFortschritt(): ?int |
| 132 | { |
| 133 | return $this->fortschritt; |
| 134 | } |
| 135 | |
| 136 | public function setFortschritt(?int $fortschritt): static |
| 137 | { |
| 138 | $this->fortschritt = $fortschritt; |
| 139 | |
| 140 | return $this; |
| 141 | } |
| 142 | |
| 143 | public function isGanztags(): ?bool |
| 144 | { |
| 145 | return $this->ganztags; |
| 146 | } |
| 147 | |
| 148 | public function setGanztags(?bool $ganztags): static |
| 149 | { |
| 150 | $this->ganztags = $ganztags; |
| 151 | |
| 152 | return $this; |
| 153 | } |
| 154 | |
| 155 | public function getSynchid(): ?string |
| 156 | { |
| 157 | return $this->synchid; |
| 158 | } |
| 159 | |
| 160 | public function setSynchid(?string $synchid): static |
| 161 | { |
| 162 | $this->synchid = $synchid; |
| 163 | |
| 164 | return $this; |
| 165 | } |
| 166 | |
| 167 | public function getTerminstatus(): ?int |
| 168 | { |
| 169 | return $this->terminstatus; |
| 170 | } |
| 171 | |
| 172 | public function setTerminstatus(?int $terminstatus): static |
| 173 | { |
| 174 | $this->terminstatus = $terminstatus; |
| 175 | |
| 176 | return $this; |
| 177 | } |
| 178 | |
| 179 | public function getTermintyp(): ?int |
| 180 | { |
| 181 | return $this->termintyp; |
| 182 | } |
| 183 | |
| 184 | public function setTermintyp(?int $termintyp): static |
| 185 | { |
| 186 | $this->termintyp = $termintyp; |
| 187 | |
| 188 | return $this; |
| 189 | } |
| 190 | |
| 191 | public function getVaterlfdnr(): ?int |
| 192 | { |
| 193 | return $this->vaterlfdnr; |
| 194 | } |
| 195 | |
| 196 | public function setVaterlfdnr(?int $vaterlfdnr): static |
| 197 | { |
| 198 | $this->vaterlfdnr = $vaterlfdnr; |
| 199 | |
| 200 | return $this; |
| 201 | } |
| 202 | |
| 203 | public function getWiederholung(): ?int |
| 204 | { |
| 205 | return $this->wiederholung; |
| 206 | } |
| 207 | |
| 208 | public function setWiederholung(?int $wiederholung): static |
| 209 | { |
| 210 | $this->wiederholung = $wiederholung; |
| 211 | |
| 212 | return $this; |
| 213 | } |
| 214 | |
| 215 | public function getWiederholunginfo(): ?string |
| 216 | { |
| 217 | return $this->wiederholunginfo; |
| 218 | } |
| 219 | |
| 220 | public function setWiederholunginfo(?string $wiederholunginfo): static |
| 221 | { |
| 222 | $this->wiederholunginfo = $wiederholunginfo; |
| 223 | |
| 224 | return $this; |
| 225 | } |
| 226 | |
| 227 | #[\Override] |
| 228 | public function setStartzeit(\DateTimeImmutable|\DateTime|null $startzeit = null): static |
| 229 | { |
| 230 | if ($startzeit !== null) { |
| 231 | $mutable = $startzeit instanceof \DateTimeImmutable |
| 232 | ? \DateTime::createFromImmutable($startzeit) |
| 233 | : $startzeit; |
| 234 | $mutable->setTime(0, 0, 0); |
| 235 | $this->startzeit = \DateTimeImmutable::createFromMutable($mutable); |
| 236 | } else { |
| 237 | $this->startzeit = null; |
| 238 | } |
| 239 | |
| 240 | return $this; |
| 241 | } |
| 242 | |
| 243 | public function setFaelligAm(\DateTimeImmutable|\DateTime|null $endzeit = null): static |
| 244 | { |
| 245 | if ($endzeit !== null) { |
| 246 | $mutable = $endzeit instanceof \DateTimeImmutable |
| 247 | ? \DateTime::createFromImmutable($endzeit) |
| 248 | : $endzeit; |
| 249 | $mutable->setTime(23, 59, 59); |
| 250 | $immutable = \DateTimeImmutable::createFromMutable($mutable); |
| 251 | $this->endzeit = $immutable; |
| 252 | if ($this->getStartzeit() === null || $this->getStartzeit() > $immutable) { |
| 253 | $this->setStartzeit($immutable); |
| 254 | } |
| 255 | } else { |
| 256 | $this->endzeit = null; |
| 257 | } |
| 258 | |
| 259 | return $this; |
| 260 | } |
| 261 | |
| 262 | public function getFaelligAm(): ?\DateTimeImmutable |
| 263 | { |
| 264 | return $this->endzeit; |
| 265 | } |
| 266 | |
| 267 | #[\Override] |
| 268 | public function __toString(): string |
| 269 | { |
| 270 | return \sprintf('\\Aufgabe:%s (%s)', $this->lfdnr, $this->betreff); |
| 271 | } |
| 272 | } |