Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
10.08% |
13 / 129 |
|
0.00% |
0 / 62 |
CRAP | |
0.00% |
0 / 1 |
| Artikelgruppe | |
10.08% |
13 / 129 |
|
0.00% |
0 / 62 |
4388.08 | |
0.00% |
0 / 1 |
| __construct | |
75.00% |
3 / 4 |
|
0.00% |
0 / 1 |
2.06 | |||
| __toString | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |||
| addArtikel | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
12 | |||
| addArtikelArtikelgruppe | |
83.33% |
5 / 6 |
|
0.00% |
0 / 1 |
2.02 | |||
| addKind | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |||
| getArt | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setArt | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getArtikel | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |||
| getArtikelArtikelgruppen | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getBezeichnung | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setBezeichnung | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getBezeichnung2 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setBezeichnung2 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getBezeichnung3 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setBezeichnung3 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getBezeichnung4 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setBezeichnung4 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getBezeichnung5 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setBezeichnung5 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getBild | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setBild | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getEkausland | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setEkausland | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getEkegmitid | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setEkegmitid | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getEkegohneid | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setEkegohneid | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getEkkto | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setEkkto | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getErloesausland | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setErloesausland | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getErloesegmitid | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setErloesegmitid | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getErloesegohneid | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setErloesegohneid | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getErloeskto | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setErloeskto | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getKinder | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getLfdnr | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setName | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getRabattgruppeek | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setRabattgruppeek | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getRabattgruppevk | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setRabattgruppevk | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getShopmetadescription | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setShopmetadescription | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getShopmetakeywords | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setShopmetakeywords | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getShopmetatitle | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setShopmetatitle | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getRawBild | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
12 | |||
| getVater | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setVater | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
| removeArtikel | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
12 | |||
| removeArtikelArtikelgruppe | |
83.33% |
5 / 6 |
|
0.00% |
0 / 1 |
2.02 | |||
| removeKind | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |||
| setIsLohnDienstleistung | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| setIsMaterial | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| setIsSonstiges | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| setIsUndefiniert | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| setRawBild | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Satag\AmicronEntityBundle\Entity; |
| 6 | |
| 7 | use Doctrine\Common\Collections\ArrayCollection; |
| 8 | use Doctrine\Common\Collections\Collection; |
| 9 | use Doctrine\DBAL\Types\Types; |
| 10 | use Doctrine\ORM\Mapping as ORM; |
| 11 | use Satag\AmicronEntityBundle\Traits\BlameableEntity; |
| 12 | use Satag\AmicronEntityBundle\Traits\BlameableEntityInterface; |
| 13 | use Satag\AmicronEntityBundle\Traits\PathEntity; |
| 14 | use Symfony\Component\Validator\Constraints as Assert; |
| 15 | |
| 16 | /** |
| 17 | * @see \Satag\AmicronEntityBundle\Tests\Entity\ArtikelgruppeTest |
| 18 | */ |
| 19 | #[ORM\Entity] |
| 20 | #[ORM\HasLifecycleCallbacks] |
| 21 | #[ORM\Table(name: 'ARTGRUP')] |
| 22 | #[ORM\UniqueConstraint(name: 'ARTGRUP_UK', columns: ['gruppe', 'vaterlfdnr'])] |
| 23 | class Artikelgruppe implements BlameableEntityInterface, \Stringable |
| 24 | { |
| 25 | use BlameableEntity; |
| 26 | use PathEntity; |
| 27 | |
| 28 | #[ORM\Column(name: 'art', type: Types::STRING, length: 1, nullable: true)] |
| 29 | #[Assert\Choice(['M', 'S', 'L', 'J', null])] |
| 30 | private ?string $art = null; |
| 31 | |
| 32 | /** |
| 33 | * @var Collection<int, ArtikelArtikelgruppe> |
| 34 | */ |
| 35 | #[ORM\OneToMany(mappedBy: 'artikelgruppe', targetEntity: ArtikelArtikelgruppe::class, cascade: ['persist'], fetch: 'EXTRA_LAZY', orphanRemoval: true)] |
| 36 | private Collection $artikel_artikelgruppen; |
| 37 | |
| 38 | #[ORM\Column(name: 'bezeichnung', type: Types::STRING, length: 60, nullable: true)] |
| 39 | private ?string $bezeichnung = null; |
| 40 | |
| 41 | #[ORM\Column(name: 'bezeichnung2', type: Types::STRING, length: 60, nullable: true)] |
| 42 | private ?string $bezeichnung2 = null; |
| 43 | |
| 44 | #[ORM\Column(name: 'bezeichnung3', type: Types::STRING, length: 60, nullable: true)] |
| 45 | private ?string $bezeichnung3 = null; |
| 46 | |
| 47 | #[ORM\Column(name: 'bezeichnung4', type: Types::STRING, length: 60, nullable: true)] |
| 48 | private ?string $bezeichnung4 = null; |
| 49 | |
| 50 | #[ORM\Column(name: 'bezeichnung5', type: Types::STRING, length: 60, nullable: true)] |
| 51 | private ?string $bezeichnung5 = null; |
| 52 | |
| 53 | #[ORM\Column(name: 'bild', type: 'blob_base64', nullable: true)] |
| 54 | #[Assert\DisableAutoMapping] |
| 55 | private ?string $bild = null; |
| 56 | |
| 57 | #[ORM\Column(name: 'ekausland', type: Types::STRING, length: 6, nullable: true)] |
| 58 | private ?string $ekausland = null; |
| 59 | |
| 60 | #[ORM\Column(name: 'ekegmitid', type: Types::STRING, length: 6, nullable: true)] |
| 61 | private ?string $ekegmitid = null; |
| 62 | |
| 63 | #[ORM\Column(name: 'ekegohneid', type: Types::STRING, length: 6, nullable: true)] |
| 64 | private ?string $ekegohneid = null; |
| 65 | |
| 66 | #[ORM\Column(name: 'ekkto', type: Types::STRING, length: 6, nullable: true)] |
| 67 | private ?string $ekkto = null; |
| 68 | |
| 69 | #[ORM\Column(name: 'erloesausland', type: Types::STRING, length: 6, nullable: true)] |
| 70 | private ?string $erloesausland = null; |
| 71 | |
| 72 | #[ORM\Column(name: 'erloesegmitid', type: Types::STRING, length: 6, nullable: true)] |
| 73 | private ?string $erloesegmitid = null; |
| 74 | |
| 75 | #[ORM\Column(name: 'erloesegohneid', type: Types::STRING, length: 6, nullable: true)] |
| 76 | private ?string $erloesegohneid = null; |
| 77 | |
| 78 | #[ORM\Column(name: 'erloeskto', type: Types::STRING, length: 6, nullable: true)] |
| 79 | private ?string $erloeskto = null; |
| 80 | |
| 81 | /** |
| 82 | * @var Collection<int, Artikelgruppe> |
| 83 | */ |
| 84 | #[ORM\OneToMany(mappedBy: 'vater', targetEntity: Artikelgruppe::class)] |
| 85 | private Collection $kinder; |
| 86 | |
| 87 | #[ORM\Column(name: 'lfdnr', type: Types::INTEGER, nullable: false)] |
| 88 | #[ORM\Id] |
| 89 | #[ORM\GeneratedValue(strategy: 'SEQUENCE')] |
| 90 | #[ORM\SequenceGenerator(sequenceName: 'GEN_LFDNR', allocationSize: 1, initialValue: 1)] |
| 91 | public private(set) ?int $lfdnr = null; |
| 92 | |
| 93 | #[ORM\Column(name: 'gruppe', type: Types::STRING, length: 32, unique: true, nullable: false)] |
| 94 | private string $name = ''; |
| 95 | |
| 96 | #[ORM\Column(name: 'rabattgruppeek', type: Types::STRING, length: 20, nullable: true)] |
| 97 | private ?string $rabattgruppeek = null; |
| 98 | |
| 99 | #[ORM\Column(name: 'rabattgruppevk', type: Types::STRING, length: 20, nullable: true)] |
| 100 | private ?string $rabattgruppevk = null; |
| 101 | |
| 102 | #[ORM\Column(name: 'shopmetadescription', type: Types::TEXT, nullable: true)] |
| 103 | private ?string $shopmetadescription = null; |
| 104 | |
| 105 | #[ORM\Column(name: 'shopmetakeywords', type: Types::TEXT, nullable: true)] |
| 106 | private ?string $shopmetakeywords = null; |
| 107 | |
| 108 | #[ORM\Column(name: 'shopmetatitle', type: Types::TEXT, nullable: true)] |
| 109 | private ?string $shopmetatitle = null; |
| 110 | |
| 111 | #[ORM\ManyToOne(targetEntity: Artikelgruppe::class, cascade: ['persist'], inversedBy: 'kinder')] |
| 112 | #[ORM\JoinColumn(name: 'vaterlfdnr', referencedColumnName: 'lfdnr')] |
| 113 | private ?Artikelgruppe $vater = null; |
| 114 | |
| 115 | public function __construct( |
| 116 | ?string $name = null |
| 117 | ) { |
| 118 | if ($name !== null) { |
| 119 | $this->setName($name); |
| 120 | } |
| 121 | $this->artikel_artikelgruppen = new ArrayCollection(); |
| 122 | $this->kinder = new ArrayCollection(); |
| 123 | } |
| 124 | |
| 125 | public function __toString(): string |
| 126 | { |
| 127 | $path = $this->getPath(); |
| 128 | |
| 129 | return trim(\sprintf('%s%s (ID: %s)', $path ? $path . ' > ' : '', $this->getName(), $this->lfdnr)); |
| 130 | } |
| 131 | |
| 132 | public function addArtikel(Artikel $artikel): self |
| 133 | { |
| 134 | foreach ($this->getArtikelArtikelgruppen() as $artikelArtikelgruppe) { |
| 135 | if ($artikelArtikelgruppe->getArtikel() === $artikel) { |
| 136 | return $this; |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | $artikelArtikelgruppe = new ArtikelArtikelgruppe(); |
| 141 | $artikelArtikelgruppe->setArtikel($artikel); |
| 142 | $artikelArtikelgruppe->setArtikelgruppe($this); |
| 143 | $this->addArtikelArtikelgruppe($artikelArtikelgruppe); |
| 144 | |
| 145 | return $this; |
| 146 | } |
| 147 | |
| 148 | public function addArtikelArtikelgruppe(ArtikelArtikelgruppe $artikelArtikelgruppe): self |
| 149 | { |
| 150 | if ($this->artikel_artikelgruppen->contains($artikelArtikelgruppe)) { |
| 151 | return $this; |
| 152 | } |
| 153 | |
| 154 | $this->artikel_artikelgruppen->add($artikelArtikelgruppe); |
| 155 | $artikelArtikelgruppe->setArtikelgruppe($this); |
| 156 | $artikelArtikelgruppe->getArtikel()?->addArtikelArtikelgruppe($artikelArtikelgruppe); |
| 157 | |
| 158 | return $this; |
| 159 | } |
| 160 | |
| 161 | public function addKind(self $gruppe): void |
| 162 | { |
| 163 | if ($this->kinder->contains($gruppe)) { |
| 164 | return; |
| 165 | } |
| 166 | $this->kinder[] = $gruppe; |
| 167 | $gruppe->setVater($this); |
| 168 | } |
| 169 | |
| 170 | public function getArt(): ?string |
| 171 | { |
| 172 | return $this->art; |
| 173 | } |
| 174 | |
| 175 | /** |
| 176 | * M = Material/Ware |
| 177 | * S = Sonstiges |
| 178 | * L = Lohn/Dienstleistung |
| 179 | * J|null = - . |
| 180 | * |
| 181 | * @return $this |
| 182 | */ |
| 183 | public function setArt(?string $art): self |
| 184 | { |
| 185 | $this->art = $art; |
| 186 | |
| 187 | return $this; |
| 188 | } |
| 189 | |
| 190 | /** |
| 191 | * @return Collection<int, Artikel> |
| 192 | */ |
| 193 | public function getArtikel(): Collection |
| 194 | { |
| 195 | $artikel = new ArrayCollection(); |
| 196 | foreach ($this->getArtikelArtikelgruppen() as $artikelArtikelgruppen) { |
| 197 | $artikel->add($artikelArtikelgruppen->getArtikel()); |
| 198 | } |
| 199 | |
| 200 | return $artikel; |
| 201 | } |
| 202 | |
| 203 | /** |
| 204 | * @return Collection<int, ArtikelArtikelgruppe> |
| 205 | */ |
| 206 | public function getArtikelArtikelgruppen(): ArrayCollection|Collection |
| 207 | { |
| 208 | return $this->artikel_artikelgruppen; |
| 209 | } |
| 210 | |
| 211 | public function getBezeichnung(): ?string |
| 212 | { |
| 213 | return $this->bezeichnung; |
| 214 | } |
| 215 | |
| 216 | public function setBezeichnung(?string $bezeichnung): self |
| 217 | { |
| 218 | $this->bezeichnung = $bezeichnung; |
| 219 | |
| 220 | return $this; |
| 221 | } |
| 222 | |
| 223 | public function getBezeichnung2(): ?string |
| 224 | { |
| 225 | return $this->bezeichnung2; |
| 226 | } |
| 227 | |
| 228 | public function setBezeichnung2(?string $bezeichnung2): self |
| 229 | { |
| 230 | $this->bezeichnung2 = $bezeichnung2; |
| 231 | |
| 232 | return $this; |
| 233 | } |
| 234 | |
| 235 | public function getBezeichnung3(): ?string |
| 236 | { |
| 237 | return $this->bezeichnung3; |
| 238 | } |
| 239 | |
| 240 | public function setBezeichnung3(?string $bezeichnung3): self |
| 241 | { |
| 242 | $this->bezeichnung3 = $bezeichnung3; |
| 243 | |
| 244 | return $this; |
| 245 | } |
| 246 | |
| 247 | public function getBezeichnung4(): ?string |
| 248 | { |
| 249 | return $this->bezeichnung4; |
| 250 | } |
| 251 | |
| 252 | public function setBezeichnung4(?string $bezeichnung4): self |
| 253 | { |
| 254 | $this->bezeichnung4 = $bezeichnung4; |
| 255 | |
| 256 | return $this; |
| 257 | } |
| 258 | |
| 259 | public function getBezeichnung5(): ?string |
| 260 | { |
| 261 | return $this->bezeichnung5; |
| 262 | } |
| 263 | |
| 264 | public function setBezeichnung5(?string $bezeichnung5): self |
| 265 | { |
| 266 | $this->bezeichnung5 = $bezeichnung5; |
| 267 | |
| 268 | return $this; |
| 269 | } |
| 270 | |
| 271 | /** |
| 272 | * Return a base64 encoded image. |
| 273 | */ |
| 274 | public function getBild(): ?string |
| 275 | { |
| 276 | return $this->bild; |
| 277 | } |
| 278 | |
| 279 | /** |
| 280 | * base64_encode image. |
| 281 | * |
| 282 | * @return $this |
| 283 | */ |
| 284 | public function setBild(?string $bild): self |
| 285 | { |
| 286 | $this->bild = $bild; |
| 287 | |
| 288 | return $this; |
| 289 | } |
| 290 | |
| 291 | public function getEkausland(): ?string |
| 292 | { |
| 293 | return $this->ekausland; |
| 294 | } |
| 295 | |
| 296 | public function setEkausland(?string $ekausland): self |
| 297 | { |
| 298 | $this->ekausland = $ekausland; |
| 299 | |
| 300 | return $this; |
| 301 | } |
| 302 | |
| 303 | public function getEkegmitid(): ?string |
| 304 | { |
| 305 | return $this->ekegmitid; |
| 306 | } |
| 307 | |
| 308 | public function setEkegmitid(?string $ekegmitid): self |
| 309 | { |
| 310 | $this->ekegmitid = $ekegmitid; |
| 311 | |
| 312 | return $this; |
| 313 | } |
| 314 | |
| 315 | public function getEkegohneid(): ?string |
| 316 | { |
| 317 | return $this->ekegohneid; |
| 318 | } |
| 319 | |
| 320 | public function setEkegohneid(?string $ekegohneid): self |
| 321 | { |
| 322 | $this->ekegohneid = $ekegohneid; |
| 323 | |
| 324 | return $this; |
| 325 | } |
| 326 | |
| 327 | public function getEkkto(): ?string |
| 328 | { |
| 329 | return $this->ekkto; |
| 330 | } |
| 331 | |
| 332 | public function setEkkto(?string $ekkto): self |
| 333 | { |
| 334 | $this->ekkto = $ekkto; |
| 335 | |
| 336 | return $this; |
| 337 | } |
| 338 | |
| 339 | public function getErloesausland(): ?string |
| 340 | { |
| 341 | return $this->erloesausland; |
| 342 | } |
| 343 | |
| 344 | public function setErloesausland(?string $erloesausland): self |
| 345 | { |
| 346 | $this->erloesausland = $erloesausland; |
| 347 | |
| 348 | return $this; |
| 349 | } |
| 350 | |
| 351 | public function getErloesegmitid(): ?string |
| 352 | { |
| 353 | return $this->erloesegmitid; |
| 354 | } |
| 355 | |
| 356 | public function setErloesegmitid(?string $erloesegmitid): self |
| 357 | { |
| 358 | $this->erloesegmitid = $erloesegmitid; |
| 359 | |
| 360 | return $this; |
| 361 | } |
| 362 | |
| 363 | public function getErloesegohneid(): ?string |
| 364 | { |
| 365 | return $this->erloesegohneid; |
| 366 | } |
| 367 | |
| 368 | public function setErloesegohneid(?string $erloesegohneid): self |
| 369 | { |
| 370 | $this->erloesegohneid = $erloesegohneid; |
| 371 | |
| 372 | return $this; |
| 373 | } |
| 374 | |
| 375 | public function getErloeskto(): ?string |
| 376 | { |
| 377 | return $this->erloeskto; |
| 378 | } |
| 379 | |
| 380 | public function setErloeskto(?string $erloeskto): self |
| 381 | { |
| 382 | $this->erloeskto = $erloeskto; |
| 383 | |
| 384 | return $this; |
| 385 | } |
| 386 | |
| 387 | /** |
| 388 | * @return Collection<int, Artikelgruppe> |
| 389 | */ |
| 390 | public function getKinder(): Collection |
| 391 | { |
| 392 | return $this->kinder; |
| 393 | } |
| 394 | |
| 395 | public function getLfdnr(): ?int |
| 396 | { |
| 397 | return $this->lfdnr; |
| 398 | } |
| 399 | |
| 400 | public function getName(): string |
| 401 | { |
| 402 | return $this->name; |
| 403 | } |
| 404 | |
| 405 | public function setName(string $name): self |
| 406 | { |
| 407 | $this->name = $name; |
| 408 | |
| 409 | return $this; |
| 410 | } |
| 411 | |
| 412 | public function getRabattgruppeek(): ?string |
| 413 | { |
| 414 | return $this->rabattgruppeek; |
| 415 | } |
| 416 | |
| 417 | public function setRabattgruppeek(?string $rabattgruppeek): self |
| 418 | { |
| 419 | $this->rabattgruppeek = $rabattgruppeek; |
| 420 | |
| 421 | return $this; |
| 422 | } |
| 423 | |
| 424 | public function getRabattgruppevk(): ?string |
| 425 | { |
| 426 | return $this->rabattgruppevk; |
| 427 | } |
| 428 | |
| 429 | public function setRabattgruppevk(?string $rabattgruppevk): self |
| 430 | { |
| 431 | $this->rabattgruppevk = $rabattgruppevk; |
| 432 | |
| 433 | return $this; |
| 434 | } |
| 435 | |
| 436 | public function getShopmetadescription(): ?string |
| 437 | { |
| 438 | return $this->shopmetadescription; |
| 439 | } |
| 440 | |
| 441 | public function setShopmetadescription(?string $shopmetadescription): self |
| 442 | { |
| 443 | $this->shopmetadescription = $shopmetadescription; |
| 444 | |
| 445 | return $this; |
| 446 | } |
| 447 | |
| 448 | public function getShopmetakeywords(): ?string |
| 449 | { |
| 450 | return $this->shopmetakeywords; |
| 451 | } |
| 452 | |
| 453 | public function setShopmetakeywords(?string $shopmetakeywords): self |
| 454 | { |
| 455 | $this->shopmetakeywords = $shopmetakeywords; |
| 456 | |
| 457 | return $this; |
| 458 | } |
| 459 | |
| 460 | public function getShopmetatitle(): ?string |
| 461 | { |
| 462 | return $this->shopmetatitle; |
| 463 | } |
| 464 | |
| 465 | public function setShopmetatitle(?string $shopmetatitle): self |
| 466 | { |
| 467 | $this->shopmetatitle = $shopmetatitle; |
| 468 | |
| 469 | return $this; |
| 470 | } |
| 471 | |
| 472 | public function getRawBild(): ?string |
| 473 | { |
| 474 | if ($this->bild === null) { |
| 475 | return null; |
| 476 | } |
| 477 | |
| 478 | $decoded = base64_decode($this->bild, true); |
| 479 | |
| 480 | return $decoded !== false ? $decoded : null; |
| 481 | } |
| 482 | |
| 483 | public function getVater(): ?self |
| 484 | { |
| 485 | return $this->vater; |
| 486 | } |
| 487 | |
| 488 | public function setVater(?self $vater): self |
| 489 | { |
| 490 | if ($this !== $vater) { |
| 491 | $this->vater = $vater; // disallow self reference |
| 492 | } |
| 493 | |
| 494 | return $this; |
| 495 | } |
| 496 | |
| 497 | public function removeArtikel(Artikel $artikel): self |
| 498 | { |
| 499 | foreach ($this->getArtikelArtikelgruppen() as $artikelArtikelgruppe) { |
| 500 | if ($artikelArtikelgruppe->getArtikel() === $artikel) { |
| 501 | $this->removeArtikelArtikelgruppe($artikelArtikelgruppe); |
| 502 | |
| 503 | return $this; |
| 504 | } |
| 505 | } |
| 506 | |
| 507 | return $this; |
| 508 | } |
| 509 | |
| 510 | public function removeArtikelArtikelgruppe(ArtikelArtikelgruppe $artikelArtikelgruppe): self |
| 511 | { |
| 512 | if (!$this->artikel_artikelgruppen->contains($artikelArtikelgruppe)) { |
| 513 | return $this; |
| 514 | } |
| 515 | |
| 516 | $artikelArtikelgruppe->getArtikel()?->removeArtikelArtikelgruppe($artikelArtikelgruppe); |
| 517 | $this->artikel_artikelgruppen->removeElement($artikelArtikelgruppe); |
| 518 | $artikelArtikelgruppe->setArtikel(null); |
| 519 | |
| 520 | return $this; |
| 521 | } |
| 522 | |
| 523 | public function removeKind(self $gruppe): void |
| 524 | { |
| 525 | if (!$this->kinder->contains($gruppe)) { |
| 526 | return; |
| 527 | } |
| 528 | |
| 529 | $this->kinder->removeElement($gruppe); |
| 530 | // needed to update the owning side of the relationship! |
| 531 | $gruppe->setVater(null); |
| 532 | } |
| 533 | |
| 534 | public function setIsLohnDienstleistung(): self |
| 535 | { |
| 536 | $this->setArt('L'); |
| 537 | |
| 538 | return $this; |
| 539 | } |
| 540 | |
| 541 | public function setIsMaterial(): self |
| 542 | { |
| 543 | $this->setArt('M'); |
| 544 | |
| 545 | return $this; |
| 546 | } |
| 547 | |
| 548 | public function setIsSonstiges(): self |
| 549 | { |
| 550 | $this->setArt('S'); |
| 551 | |
| 552 | return $this; |
| 553 | } |
| 554 | |
| 555 | public function setIsUndefiniert(): self |
| 556 | { |
| 557 | $this->setArt('J'); |
| 558 | |
| 559 | return $this; |
| 560 | } |
| 561 | |
| 562 | public function setRawBild(?string $imageData): self |
| 563 | { |
| 564 | if ($imageData !== null) { |
| 565 | $this->setBild(base64_encode($imageData)); |
| 566 | } else { |
| 567 | $this->setBild(null); |
| 568 | } |
| 569 | |
| 570 | return $this; |
| 571 | } |
| 572 | } |