src/Entity/ProductPercentageSplit.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProductPercentageSplitRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassProductPercentageSplitRepository::class)]
  6. class ProductPercentageSplit
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private $id;
  12.     #[ORM\Column(type'string'length255nullabletrue)]
  13.     private $name;
  14.     #[ORM\Column(type'float'nullabletrue)]
  15.     private $percentage;
  16.     #[ORM\Column(type'string'length255nullabletrue)]
  17.     private $glCode;
  18.     #[ORM\ManyToOne(targetEntityProduct::class, inversedBy'percentageSplits')]
  19.     private $product;
  20.     #[ORM\Column(length255nullabletrue)]
  21.     private ?string $accountId null;
  22.     #[ORM\Column(nullabletrue)]
  23.     private ?bool $isRoundDown null;
  24.     #[ORM\Column(length255nullabletrue)]
  25.     private ?string $refundCode null;
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getName(): ?string
  31.     {
  32.         return $this->name;
  33.     }
  34.     public function setName(?string $name): self
  35.     {
  36.         $this->name $name;
  37.         return $this;
  38.     }
  39.     public function getPercentage(): ?float
  40.     {
  41.         return $this->percentage;
  42.     }
  43.     public function setPercentage(?float $percentage): self
  44.     {
  45.         $this->percentage $percentage;
  46.         return $this;
  47.     }
  48.     public function getGlCode(): ?string
  49.     {
  50.         return $this->glCode;
  51.     }
  52.     public function setGlCode(?string $glCode): self
  53.     {
  54.         $this->glCode $glCode;
  55.         return $this;
  56.     }
  57.     public function getProduct(): ?Product
  58.     {
  59.         return $this->product;
  60.     }
  61.     public function setProduct(?Product $product): self
  62.     {
  63.         $this->product $product;
  64.         return $this;
  65.     }
  66.     public function toString()
  67.     {
  68.         $string '-';
  69.         if ($this->name) {
  70.             $string $this->name ' - ' $this->percentage '%';
  71.         }
  72.         return $string;
  73.     }
  74.     public function __toString()
  75.     {
  76.         return $this->toString();
  77.     }
  78.     public function getAccountId(): ?string
  79.     {
  80.         return $this->accountId;
  81.     }
  82.     public function setAccountId(?string $accountId): self
  83.     {
  84.         $this->accountId $accountId;
  85.         return $this;
  86.     }
  87.     public function isIsRoundDown(): ?bool
  88.     {
  89.         return $this->isRoundDown;
  90.     }
  91.     public function setIsRoundDown(?bool $isRoundDown): self
  92.     {
  93.         $this->isRoundDown $isRoundDown;
  94.         return $this;
  95.     }
  96.     public function getRefundCode(): ?string
  97.     {
  98.         return $this->refundCode;
  99.     }
  100.     public function setRefundCode(?string $refundCode): static
  101.     {
  102.         $this->refundCode $refundCode;
  103.         return $this;
  104.     }
  105. }