src/Entity/EarningGroup.php line 13
<?phpnamespace App\Entity;use App\Repository\EarningGroupRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Gedmo\Timestampable\Traits\TimestampableEntity;#[ORM\Entity(repositoryClass: EarningGroupRepository::class)]class EarningGroup{use TimestampableEntity;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $description = null;#[ORM\OneToMany(mappedBy: 'earningGroup', targetEntity: RuleResult::class)]private Collection $ruleResults;#[ORM\OneToMany(mappedBy: 'earningGroup', targetEntity: Commission::class)]private Collection $commissions;#[ORM\Column]private ?bool $incentiveStatement = false;#[ORM\OneToMany(mappedBy: 'earningGroup', targetEntity: ManualPayment::class)]private Collection $manualPayments;public function __construct(){$this->ruleResults = new ArrayCollection();$this->commissions = new ArrayCollection();$this->manualPayments = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getName(): ?string{return $this->name;}public function setName(string $name): static{$this->name = $name;return $this;}public function getDescription(): ?string{return $this->description;}public function setDescription(?string $description): static{$this->description = $description;return $this;}/*** @return Collection<int, RuleResult>*/public function getRuleResults(): Collection{return $this->ruleResults;}public function addRuleResult(RuleResult $ruleResult): static{if (!$this->ruleResults->contains($ruleResult)) {$this->ruleResults->add($ruleResult);$ruleResult->setEarningGroup($this);}return $this;}public function removeRuleResult(RuleResult $ruleResult): static{if ($this->ruleResults->removeElement($ruleResult)) {// set the owning side to null (unless already changed)if ($ruleResult->getEarningGroup() === $this) {$ruleResult->setEarningGroup(null);}}return $this;}/*** @return Collection<int, Commission>*/public function getCommissions(): Collection{return $this->commissions;}public function addCommission(Commission $commission): static{if (!$this->commissions->contains($commission)) {$this->commissions->add($commission);$commission->setEarningGroup($this);}return $this;}public function removeCommission(Commission $commission): static{if ($this->commissions->removeElement($commission)) {// set the owning side to null (unless already changed)if ($commission->getEarningGroup() === $this) {$commission->setEarningGroup(null);}}return $this;}public function isIncentiveStatement(): ?bool{return $this->incentiveStatement;}public function setIncentiveStatement(bool $incentiveStatement): static{$this->incentiveStatement = $incentiveStatement;return $this;}/*** @return Collection<int, ManualPayment>*/public function getManualPayments(): Collection{return $this->manualPayments;}public function addManualPayment(ManualPayment $manualPayment): static{if (!$this->manualPayments->contains($manualPayment)) {$this->manualPayments->add($manualPayment);$manualPayment->setEarningGroup($this);}return $this;}public function removeManualPayment(ManualPayment $manualPayment): static{if ($this->manualPayments->removeElement($manualPayment)) {// set the owning side to null (unless already changed)if ($manualPayment->getEarningGroup() === $this) {$manualPayment->setEarningGroup(null);}}return $this;}public function __toString(): string{return $this->name;}}