Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
91.30% covered (success)
91.30%
21 / 23
92.86% covered (success)
92.86%
13 / 14
CRAP
0.00% covered (danger)
0.00%
0 / 1
PreisgruppePreis
91.30% covered (success)
91.30%
21 / 23
92.86% covered (success)
92.86%
13 / 14
16.17
0.00% covered (danger)
0.00%
0 / 1
 __construct
50.00% covered (danger)
50.00%
2 / 4
0.00% covered (danger)
0.00%
0 / 1
4.12
 getAbmenge
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setAbmenge
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getArtikel
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setArtikel
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getBruttopreis
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setBruttopreis
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getGlobalermengenstaffelpreis
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setGlobalermengenstaffelpreis
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
 getNettopreis
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setNettopreis
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getPreisgruppe
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setPreisgruppe
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;
12
13/**
14 * @see \Satag\AmicronEntityBundle\Tests\Entity\PreisgruppePreisTest
15 */
16#[ORM\Entity]
17#[ORM\HasLifecycleCallbacks]
18#[ORM\Table(name: 'PREISGRUPPENPREISE')]
19#[ORM\Index(columns: ['bezeichnung'], name: 'PREISGRUPPEN_BEZEICHNUNG_UK')]
20#[ORM\UniqueConstraint(name: 'PREISGRUPPENPREISE_UK', columns: ['artikellfdnr', 'preisgruppenlfdnr', 'abmenge', 'globalermengenstaffelpreis'])]
21class PreisgruppePreis extends AbstractAmicronEntity implements BlameableEntityInterface
22{
23    use BlameableEntity;
24    use DecimalEntity;
25
26    #[ORM\Column(name: 'abmenge', type: 'amicron_decimal', precision: 15, scale: 6, nullable: true)]
27    private ?string $abmenge = null;
28
29    #[ORM\ManyToOne(targetEntity: Artikel::class, cascade: ['persist'])]
30    #[ORM\JoinColumn(name: 'artikellfdnr', referencedColumnName: 'lfdnr')]
31    private ?Artikel $artikel = null;
32
33    #[ORM\Column(name: 'bruttopreis', type: 'amicron_decimal', precision: 15, scale: 6, nullable: true)]
34    private ?string $bruttopreis = null;
35
36    #[ORM\Column(name: 'globalermengenstaffelpreis', type: 'boolean_int', nullable: true)]
37    private ?bool $globalermengenstaffelpreis = null;
38
39    #[ORM\Column(name: 'lfdnr', type: Types::INTEGER, nullable: false)]
40    #[ORM\Id]
41    #[ORM\GeneratedValue(strategy: 'SEQUENCE')]
42    #[ORM\SequenceGenerator(sequenceName: 'GEN_LFDNR', allocationSize: 1, initialValue: 1)]
43    public private(set) ?int $lfdnr = null;
44
45    #[ORM\Column(name: 'nettopreis', type: 'amicron_decimal', precision: 15, scale: 6, nullable: true)]
46    private ?string $nettopreis = null;
47
48    #[ORM\ManyToOne(targetEntity: Preisgruppe::class, cascade: ['persist'])]
49    #[ORM\JoinColumn(name: 'preisgruppenlfdnr', referencedColumnName: 'lfdnr')]
50    private ?Preisgruppe $preisgruppe = null;
51
52    public function __construct(
53        ?Preisgruppe $preisgruppe = null,
54        ?Artikel $artikel = null
55    ) {
56        if ($preisgruppe) {
57            $this->setPreisgruppe($preisgruppe);
58        }
59        if ($artikel) {
60            $this->setArtikel($artikel);
61        }
62    }
63
64    public function getAbmenge(): ?string
65    {
66        return $this->abmenge;
67    }
68
69    /**
70     * @return $this
71     */
72    public function setAbmenge(?string $abmenge): self
73    {
74        $this->abmenge = $abmenge;
75
76        return $this;
77    }
78
79    public function getArtikel(): ?Artikel
80    {
81        return $this->artikel;
82    }
83
84    public function setArtikel(?Artikel $artikel): self
85    {
86        $this->artikel = $artikel;
87
88        return $this;
89    }
90
91    public function getBruttopreis(): ?string
92    {
93        return $this->bruttopreis;
94    }
95
96    public function setBruttopreis(?string $bruttopreis): self
97    {
98        $this->bruttopreis = $bruttopreis;
99
100        return $this;
101    }
102
103    public function getGlobalermengenstaffelpreis(): ?bool
104    {
105        return $this->globalermengenstaffelpreis;
106    }
107
108    public function setGlobalermengenstaffelpreis(?bool $globalermengenstaffelpreis): self
109    {
110        $this->globalermengenstaffelpreis = $globalermengenstaffelpreis;
111
112        return $this;
113    }
114
115    public function getLfdnr(): ?int
116    {
117        return $this->lfdnr;
118    }
119
120    public function getNettopreis(): ?string
121    {
122        return $this->nettopreis;
123    }
124
125    public function setNettopreis(?string $nettopreis): self
126    {
127        $this->nettopreis = $nettopreis;
128
129        return $this;
130    }
131
132    public function getPreisgruppe(): ?Preisgruppe
133    {
134        return $this->preisgruppe;
135    }
136
137    public function setPreisgruppe(Preisgruppe $preisgruppe): self
138    {
139        $this->preisgruppe = $preisgruppe;
140
141        return $this;
142    }
143}