src/Entity/AffiliateService.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AffiliateServiceRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. #[ORM\Entity(repositoryClassAffiliateServiceRepository::class)]
  9. class AffiliateService
  10. {
  11.   #[ORM\Id]
  12.   #[ORM\GeneratedValue]
  13.   #[ORM\Column(type'integer')]
  14.   private $id;
  15.   #[ORM\Column(type'string'length255)]
  16.   private $name;
  17.   #[ORM\Column(type'boolean'nullabletrue)]
  18.   private $recurrent;
  19.   #[ORM\Column(type'float'nullabletrue)]
  20.   #[Assert\Range(min0max1)]
  21.   private $percentageOneshot;
  22.   #[ORM\Column(type'float'nullabletrue)]
  23.   #[Assert\Range(min0max1)]
  24.   private $percentageFirstYear;
  25.   #[ORM\Column(type'float'nullabletrue)]
  26.   #[Assert\Range(min0max1)]
  27.   private $percentageSecondYear;
  28.   #[ORM\Column(type'float'nullabletrue)]
  29.   #[Assert\Range(min0max1)]
  30.   private $percentageThirdYear;
  31.   #[ORM\OneToMany(mappedBy'service'targetEntityAffiliateClientService::class)]
  32.   private $affiliateClientServices;
  33.   #[ORM\Column(type'float'nullabletrue)]
  34.   private $defaultPrice;
  35.   #[ORM\Column(type'string'length255nullabletrue)]
  36.   private $type;
  37.   public function __construct()
  38.   {
  39.     $this->affiliateClientServices = new ArrayCollection();
  40.   }
  41.   public function __toString(): string
  42.   {
  43.     return $this->name;
  44.   }
  45.   public function getId(): ?int
  46.   {
  47.     return $this->id;
  48.   }
  49.   public function getName(): ?string
  50.   {
  51.     return $this->name;
  52.   }
  53.   public function setName(string $name): self
  54.   {
  55.     $this->name $name;
  56.     return $this;
  57.   }
  58.   public function isRecurrent(): ?bool
  59.   {
  60.     return $this->recurrent;
  61.   }
  62.   public function setRecurrent(?bool $recurrent): self
  63.   {
  64.     $this->recurrent $recurrent;
  65.     return $this;
  66.   }
  67.   public function getPercentageOneshot(): ?float
  68.   {
  69.     return $this->percentageOneshot;
  70.   }
  71.   public function setPercentageOneshot(?float $percentageOneshot): self
  72.   {
  73.     $this->percentageOneshot $percentageOneshot;
  74.     return $this;
  75.   }
  76.   public function getPercentageFirstYear(): ?float
  77.   {
  78.     return $this->percentageFirstYear;
  79.   }
  80.   public function setPercentageFirstYear(?float $percentageFirstYear): self
  81.   {
  82.     $this->percentageFirstYear $percentageFirstYear;
  83.     return $this;
  84.   }
  85.   public function getPercentageSecondYear(): ?float
  86.   {
  87.     return $this->percentageSecondYear;
  88.   }
  89.   public function setPercentageSecondYear(?float $percentageSecondYear): self
  90.   {
  91.     $this->percentageSecondYear $percentageSecondYear;
  92.     return $this;
  93.   }
  94.   public function getPercentageThirdYear(): ?float
  95.   {
  96.     return $this->percentageThirdYear;
  97.   }
  98.   public function setPercentageThirdYear(?float $percentageThirdYear): self
  99.   {
  100.     $this->percentageThirdYear $percentageThirdYear;
  101.     return $this;
  102.   }
  103.   /**
  104.    * @return Collection<int, AffiliateClientService>
  105.    */
  106.   public function getAffiliateClientServices(): Collection
  107.   {
  108.     return $this->affiliateClientServices;
  109.   }
  110.   public function addAffiliateClientService(AffiliateClientService $affiliateClientService): self
  111.   {
  112.     if (!$this->affiliateClientServices->contains($affiliateClientService)) {
  113.       $this->affiliateClientServices[] = $affiliateClientService;
  114.       $affiliateClientService->setService($this);
  115.     }
  116.     return $this;
  117.   }
  118.   public function removeAffiliateClientService(AffiliateClientService $affiliateClientService): self
  119.   {
  120.     if ($this->affiliateClientServices->removeElement($affiliateClientService)) {
  121.       // set the owning side to null (unless already changed)
  122.       if ($affiliateClientService->getService() === $this) {
  123.         $affiliateClientService->setService(null);
  124.       }
  125.     }
  126.     return $this;
  127.   }
  128.   public function getDefaultPrice(): ?float
  129.   {
  130.       return $this->defaultPrice;
  131.   }
  132.   public function setDefaultPrice(?float $defaultPrice): self
  133.   {
  134.       $this->defaultPrice $defaultPrice;
  135.       return $this;
  136.   }
  137.   public function getType(): ?string
  138.   {
  139.       return $this->type;
  140.   }
  141.   public function setType(?string $type): self
  142.   {
  143.       $this->type $type;
  144.       return $this;
  145.   }
  146. }