← Back
Editing: Penalty.php
<?php namespace App\Entity; use App\Repository\PenaltyRepository; use Doctrine\ORM\Mapping as ORM; #[ORM\Entity(repositoryClass: PenaltyRepository::class)] class Penalty { #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private ?int $id = null; #[ORM\ManyToOne(targetEntity: Service::class, inversedBy: 'penalties')] #[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')] private Service $service; #[ORM\Column(type: 'text')] private ?string $reason = null; #[ORM\Column(type: 'float')] private ?float $amount = null; #[ORM\Column(type: 'datetime', options: ['default' => 'CURRENT_TIMESTAMP'])] private \DateTimeInterface $createdAt; #[ORM\Column(type: 'date', nullable: true)] private ?\DateTimeInterface $startDate = null; #[ORM\Column(type: 'date', nullable: true)] private ?\DateTimeInterface $endDate = null; #[ORM\Column(type: 'integer', nullable: true)] private ?int $nbDays = null; public function __construct() { $this->createdAt = new \DateTime(); } public function getId(): ?int { return $this->id; } public function getService(): Service { return $this->service; } public function setService(Service $service): self { $this->service = $service; return $this; } public function getReason(): ?string { return $this->reason; } public function setReason(string $reason): self { $this->reason = $reason; return $this; } public function getAmount(): ?float { return $this->amount; } public function setAmount(float $amount): self { $this->amount = $amount; return $this; } public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; } public function setCreatedAt(\DateTimeInterface $createdAt): self { $this->createdAt = $createdAt; return $this; } public function getStartDate(): ?\DateTimeInterface { return $this->startDate; } public function setStartDate(?\DateTimeInterface $startDate): self { $this->startDate = $startDate; return $this; } public function getEndDate(): ?\DateTimeInterface { return $this->endDate; } public function setEndDate(?\DateTimeInterface $endDate): self { $this->endDate = $endDate; return $this; } public function getNbDays(): ?int { return $this->nbDays; } public function setNbDays(?int $nbDays): self { $this->nbDays = $nbDays; return $this; } }
Save File
Cancel