feat: add doctrine-fixtures-bundle & phpstan, restructure entity mapping
- Add doctrine/doctrine-fixtures-bundle (^4.3) for database fixtures - Add phpstan/phpstan (^2.0) as dev dependency for static analysis - Register DoctrineFixturesBundle in dev/test environments - Move entity mapping to src/Data/Doctrine/Entity/Saatgut - Update entity prefix to App\Data\Doctrine\Entity\Saatgut - Change entity alias from App to Saatgut
This commit is contained in:
@@ -0,0 +1,118 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace App\Data\Doctrine\Entity\Saatgut;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'saatgut_bestand')]
|
||||
#[ORM\UniqueConstraint(name: 'unik_nutzer_pflanze', columns: ['nutzer_id', 'pflanze_id'])]
|
||||
class SaatgutBestandEntity
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
public ?int $id = null;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private string $nutzerId;
|
||||
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private int $pflanzeId;
|
||||
|
||||
#[ORM\Column(type: 'float')]
|
||||
private float $menge;
|
||||
|
||||
#[ORM\Column(type: 'date')]
|
||||
private \DateTimeInterface $kaufdatum;
|
||||
|
||||
#[ORM\Column(type: 'date', nullable: true)]
|
||||
private ?\DateTimeInterface $ablaufdatum = null;
|
||||
|
||||
#[ORM\Column(type: 'text', nullable: true)]
|
||||
private ?string $notizen = null;
|
||||
|
||||
public function __construct(
|
||||
string $nutzerId,
|
||||
int $pflanzeId,
|
||||
float $menge,
|
||||
\DateTimeInterface $kaufdatum,
|
||||
?\DateTimeInterface $ablaufdatum = null,
|
||||
?string $notizen = null,
|
||||
) {
|
||||
$this->nutzerId = $nutzerId;
|
||||
$this->pflanzeId = $pflanzeId;
|
||||
$this->menge = $menge;
|
||||
$this->kaufdatum = $kaufdatum;
|
||||
$this->ablaufdatum = $ablaufdatum;
|
||||
$this->notizen = $notizen;
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getNutzerId(): string
|
||||
{
|
||||
return $this->nutzerId;
|
||||
}
|
||||
|
||||
public function getPflanzeId(): int
|
||||
{
|
||||
return $this->pflanzeId;
|
||||
}
|
||||
|
||||
public function setPflanzeId(int $pflanzeId): self
|
||||
{
|
||||
$this->pflanzeId = $pflanzeId;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function menge(): float
|
||||
{
|
||||
return $this->menge;
|
||||
}
|
||||
|
||||
public function setMenge(float $menge): self
|
||||
{
|
||||
$this->menge = $menge;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function kaufdatum(): \DateTimeInterface
|
||||
{
|
||||
return $this->kaufdatum;
|
||||
}
|
||||
|
||||
public function setKaufdatum(\DateTimeInterface $kaufdatum): self
|
||||
{
|
||||
$this->kaufdatum = $kaufdatum;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function ablaufdatum(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->ablaufdatum;
|
||||
}
|
||||
|
||||
public function setAblaufdatum(?\DateTimeInterface $ablaufdatum): self
|
||||
{
|
||||
$this->ablaufdatum = $ablaufdatum;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function notizen(): ?string
|
||||
{
|
||||
return $this->notizen;
|
||||
}
|
||||
|
||||
public function setNotizen(?string $notizen): void
|
||||
{
|
||||
$this->notizen = $notizen;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user