<?phpnamespace App\Entity\Vs;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity]#[ORM\Table(name: 'vsstatus')]class VsStatus implements \Stringable{ public const int STAT_ERFASST = 1; // ID aus DB public const int STAT_KORREKTUR = 2; // ID aus DB public const int STAT_ANZEIGEN = 3; // ID aus DB public const int STAT_STORNIERT = 4; // ID aus DB public const int STAT_NONE = 5; // ID aus DB (NICHT ZUGEWIESEN) #[ORM\Column(name: 'id', type: 'integer')] #[ORM\Id] #[ORM\GeneratedValue(strategy: 'AUTO')] private ?int $id = null; #[ORM\Column(name: 'statusname', type: 'string', length: 200, unique: false, nullable: true)] private ?string $statusname = null; #[ORM\OneToMany(mappedBy: 'status', targetEntity: Vs::class)] private Collection $vss; public function __construct() { $this->vss = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getStatusname(): ?string { return $this->statusname; } public function setStatusname(?string $statusname): VsStatus { $this->statusname = $statusname; return $this; } public function getStatusnameShort(): string { return strtoupper(substr($this->getStatusname(), 0, 1)); } public function addVss(Vs $vss): static { $this->vss[] = $vss; return $this; } public function removeVss(Vs $vss): void { $this->vss->removeElement($vss); } public function getVss(): ArrayCollection|Collection { return $this->vss; } // Helpers public function isErfasst(): bool { return $this->id === self::STAT_ERFASST; } public function isAnzeigen(): bool { return $this->id === self::STAT_ANZEIGEN; } public function isKorrektur(): bool { return $this->id === self::STAT_KORREKTUR; } public function isStorniert(): bool { return $this->id === self::STAT_STORNIERT; } public function isNichtZugewiesen(): bool { return $this->id === self::STAT_NONE; } #[\Override] public function __toString(): string { return $this->getStatusname(); }}