<?phpnamespace App\Entity;use App\Repository\CommissionRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=CommissionRepository::class) */class Commission{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $commission_name; /** * @ORM\Column(type="integer") */ private $amount_month; /** * @ORM\Column(type="decimal", precision=10, scale=3) */ private $amount_percentage; /** * @ORM\Column(type="integer", nullable=true) */ private $reg_by; /** * @ORM\Column(type="datetime", nullable=true) */ private $reg_datetime; /** * @ORM\OneToMany(targetEntity=User::class, mappedBy="commission") */ private $users; /** * @ORM\Column(type="boolean") */ private $is_active; /** * @ORM\OneToMany(targetEntity=SalesCommission::class, mappedBy="commission") */ private $salesCommissions; public function __construct() { $this->users = new ArrayCollection(); $this->salesCommissions = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getCommissionName(): ?string { return $this->commission_name; } public function setCommissionName(string $commission_name): self { $this->commission_name = $commission_name; return $this; } public function getAmountMonth(): ?int { return $this->amount_month; } public function setAmountMonth(int $amount_month): self { $this->amount_month = $amount_month; return $this; } public function getAmountPercentage(): ?string { return $this->amount_percentage; } public function setAmountPercentage(string $amount_percentage): self { $this->amount_percentage = $amount_percentage; return $this; } public function getRegBy(): ?int { return $this->reg_by; } public function setRegBy(?int $reg_by): self { $this->reg_by = $reg_by; return $this; } public function getRegDatetime(): ?\DateTimeInterface { return $this->reg_datetime; } public function setRegDatetime(?\DateTimeInterface $reg_datetime): self { $this->reg_datetime = $reg_datetime; return $this; } /** * @return Collection<int, User> */ public function getUsers(): Collection { return $this->users; } public function addUser(User $user): self { if (!$this->users->contains($user)) { $this->users[] = $user; $user->setCommission($this); } return $this; } public function removeUser(User $user): self { if ($this->users->removeElement($user)) { // set the owning side to null (unless already changed) if ($user->getCommission() === $this) { $user->setCommission(null); } } return $this; } public function __toString() { return $this->getCommissionName(); } public function isIsActive(): ?bool { return $this->is_active; } public function setIsActive(bool $is_active): self { $this->is_active = $is_active; return $this; } /** * @return Collection<int, SalesCommission> */ public function getSalesCommissions(): Collection { return $this->salesCommissions; } public function addSalesCommission(SalesCommission $salesCommission): self { if (!$this->salesCommissions->contains($salesCommission)) { $this->salesCommissions[] = $salesCommission; $salesCommission->setCommission($this); } return $this; } public function removeSalesCommission(SalesCommission $salesCommission): self { if ($this->salesCommissions->removeElement($salesCommission)) { // set the owning side to null (unless already changed) if ($salesCommission->getCommission() === $this) { $salesCommission->setCommission(null); } } return $this; }}