src/Entity/Service.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Billing\Model\BillableItemInterface;
  4. use App\Repository\ServiceRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassServiceRepository::class)]
  7. class Service implements BillableItemInterface
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id null;
  13.     #[ORM\Column(length255)]
  14.     private ?string $nom null;
  15.     #[ORM\Column]
  16.     private ?float $prixUnitaire null;
  17.     #[ORM\Column]
  18.     private ?float $tva null;
  19.     public function getId(): ?int
  20.     {
  21.         return $this->id;
  22.     }
  23.     public function getNom(): ?string
  24.     {
  25.         return $this->nom;
  26.     }
  27.     public function setNom(string $nom): static
  28.     {
  29.         $this->nom $nom;
  30.         return $this;
  31.     }
  32.     public function getPrixUnitaire(): ?float
  33.     {
  34.         return $this->prixUnitaire;
  35.     }
  36.     public function setPrixUnitaire(float $prixUnitaire): static
  37.     {
  38.         $this->prixUnitaire $prixUnitaire;
  39.         return $this;
  40.     }
  41.     public function getTva(): ?float
  42.     {
  43.         return $this->tva;
  44.     }
  45.     public function setTva(float $tva): static
  46.     {
  47.         $this->tva $tva;
  48.         return $this;
  49.     }
  50.     public function __toString(): string
  51.     {
  52.         return $this->nom ?? '';
  53.     }
  54.     // BillableItemInterface implementation
  55.     public function getBillableDescription(): string
  56.     {
  57.         return $this->nom;
  58.     }
  59.     public function getBillablePrice(): float
  60.     {
  61.         return $this->prixUnitaire;
  62.     }
  63.     public function getBillableVatRate(): float
  64.     {
  65.         return $this->tva;
  66.     }
  67. }