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(repositoryClass: ServiceRepository::class)]
  7. class Service implements BillableItemInterface
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id = null;
  13.     #[ORM\Column(length: 255)]
  14.     private ?string $nom = null;
  15.     #[ORM\Column(length: 255, nullable: true)]
  16.     private ?string $designation = null;
  17.     #[ORM\Column]
  18.     private ?float $prixUnitaire = null;
  19.     #[ORM\Column]
  20.     private ?float $tva = null;
  21.     public function getId(): ?int
  22.     {
  23.         return $this->id;
  24.     }
  25.     public function getNom(): ?string
  26.     {
  27.         return $this->nom;
  28.     }
  29.     public function setNom(string $nom): static
  30.     {
  31.         $this->nom = $nom;
  32.         return $this;
  33.     }
  34.     public function getDesignation(): ?string
  35.     {
  36.         return $this->designation;
  37.     }
  38.     public function setDesignation(?string $designation): static
  39.     {
  40.         $this->designation = $designation;
  41.         return $this;
  42.     }
  43.     public function getPrixUnitaire(): ?float
  44.     {
  45.         return $this->prixUnitaire;
  46.     }
  47.     public function setPrixUnitaire(float $prixUnitaire): static
  48.     {
  49.         $this->prixUnitaire = $prixUnitaire;
  50.         return $this;
  51.     }
  52.     public function getTva(): ?float
  53.     {
  54.         return $this->tva;
  55.     }
  56.     public function setTva(float $tva): static
  57.     {
  58.         $this->tva = $tva;
  59.         return $this;
  60.     }
  61.     public function __toString(): string
  62.     {
  63.         return $this->nom ?? '';
  64.     }
  65.     // BillableItemInterface implementation
  66.     public function getBillableDescription(): string
  67.     {
  68.         return $this->nom;
  69.     }
  70.     public function getBillablePrice(): float
  71.     {
  72.         return $this->prixUnitaire;
  73.     }
  74.     public function getBillableVatRate(): float
  75.     {
  76.         return $this->tva;
  77.     }
  78. }