src/Entity/Period.php line 13
<?phpnamespace App\Entity;use App\Repository\PeriodRepository;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: PeriodRepository::class)]class Period{use TimestampableEntity;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255, nullable: true)]private ?string $name = null;#[ORM\Column]private ?bool $isOpen = false;#[ORM\Column]private ?bool $isPublished = false;#[ORM\Column]private ?bool $isHidden = false;#[ORM\Column]private ?bool $isCalcPeriod = false;#[ORM\Column]private ?int $orderNumber = null;#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]private ?\DateTimeInterface $startDate = null;#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]private ?\DateTimeInterface $endDate = null;#[ORM\ManyToOne(inversedBy: 'periods')]private ?Calendar $calendar = null;#[ORM\ManyToOne(inversedBy: 'periods', fetch: 'EAGER')]private ?PeriodType $periodType = null;#[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'childrenPeriods')]private ?self $parentPeriod = null;#[ORM\OneToMany(mappedBy: 'parentPeriod', targetEntity: self::class)]private Collection $childrenPeriods;#[ORM\OneToMany(mappedBy: 'period', targetEntity: Quota::class)]private Collection $quotas;#[ORM\OneToMany(mappedBy: 'period', targetEntity: QuotaAssignment::class)]private Collection $quotaAssignments;#[ORM\OneToMany(mappedBy: 'period', targetEntity: Plan::class)]private Collection $plans;#[ORM\OneToMany(mappedBy: 'period', targetEntity: Order::class)]private Collection $orders;#[ORM\OneToMany(mappedBy: 'quotaPeriod', targetEntity: RuleResult::class)]private Collection $ruleResults;#[ORM\OneToMany(mappedBy: 'period', targetEntity: Commission::class)]private Collection $commissions;#[ORM\OneToMany(mappedBy: 'period', targetEntity: Credit::class)]private Collection $credits;public function __construct(){$this->childrenPeriods = new ArrayCollection();$this->quotas = new ArrayCollection();$this->quotaAssignments = new ArrayCollection();$this->plans = new ArrayCollection();$this->orders = new ArrayCollection();$this->ruleResults = new ArrayCollection();$this->commissions = new ArrayCollection();$this->credits = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getName(): ?string{return $this->name;}public function setName(?string $name): self{$this->name = $name;return $this;}public function isIsOpen(): ?bool{return $this->isOpen;}public function setIsOpen(bool $isOpen): self{$this->isOpen = $isOpen;return $this;}public function isIsPublished(): ?bool{return $this->isPublished;}public function setIsPublished(bool $isPublished): self{$this->isPublished = $isPublished;return $this;}public function isIsHidden(): ?bool{return $this->isHidden;}public function setIsHidden(bool $isHidden): self{$this->isHidden = $isHidden;return $this;}public function isIsCalcPeriod(): ?bool{return $this->isCalcPeriod;}public function setIsCalcPeriod(bool $isCalcPeriod): self{$this->isCalcPeriod = $isCalcPeriod;return $this;}public function getOrderNumber(): ?int{return $this->orderNumber;}public function setOrderNumber(int $orderNumber): self{$this->orderNumber = $orderNumber;return $this;}public function getStartDate(): ?\DateTimeInterface{return $this->startDate;}public function setStartDate(?\DateTimeInterface $startDate): self{$this->startDate = $startDate;return $this;}public function getEndDate(): ?\DateTimeInterface{return $this->endDate;}public function setEndDate(?\DateTimeInterface $endDate): self{$this->endDate = $endDate;return $this;}public function getCalendar(): ?Calendar{return $this->calendar;}public function setCalendar(?Calendar $calendar): self{$this->calendar = $calendar;return $this;}public function getPeriodType(): ?PeriodType{return $this->periodType;}public function setPeriodType(?PeriodType $periodType): self{$this->periodType = $periodType;return $this;}public function getParentPeriod(): ?self{return $this->parentPeriod;}public function setParentPeriod(?self $parentPeriod): self{$this->parentPeriod = $parentPeriod;return $this;}/*** @return Collection<int, self>*/public function getChildrenPeriods(): Collection{return $this->childrenPeriods;}public function addChildrenPeriod(self $childrenPeriod): self{if (!$this->childrenPeriods->contains($childrenPeriod)) {$this->childrenPeriods->add($childrenPeriod);$childrenPeriod->setParentPeriod($this);}return $this;}public function removeChildrenPeriod(self $childrenPeriod): self{if ($this->childrenPeriods->removeElement($childrenPeriod)) {// set the owning side to null (unless already changed)if ($childrenPeriod->getParentPeriod() === $this) {$childrenPeriod->setParentPeriod(null);}}return $this;}/*** @return Collection<int, Quota>*/public function getQuotas(): Collection{return $this->quotas;}public function addQuota(Quota $quota): self{if (!$this->quotas->contains($quota)) {$this->quotas->add($quota);$quota->setPeriod($this);}return $this;}public function removeQuota(Quota $quota): self{if ($this->quotas->removeElement($quota)) {// set the owning side to null (unless already changed)if ($quota->getPeriod() === $this) {$quota->setPeriod(null);}}return $this;}/*** @return Collection<int, QuotaAssignment>*/public function getQuotaAssignments(): Collection{return $this->quotaAssignments;}public function addQuotaAssignment(QuotaAssignment $quotaAssignment): self{if (!$this->quotaAssignments->contains($quotaAssignment)) {$this->quotaAssignments->add($quotaAssignment);$quotaAssignment->setPeriod($this);}return $this;}public function removeQuotaAssignment(QuotaAssignment $quotaAssignment): self{if ($this->quotaAssignments->removeElement($quotaAssignment)) {// set the owning side to null (unless already changed)if ($quotaAssignment->getPeriod() === $this) {$quotaAssignment->setPeriod(null);}}return $this;}/*** @return Collection<int, Plan>*/public function getPlans(): Collection{return $this->plans;}public function addPlan(Plan $plan): self{if (!$this->plans->contains($plan)) {$this->plans->add($plan);$plan->setPeriod($this);}return $this;}public function removePlan(Plan $plan): self{if ($this->plans->removeElement($plan)) {// set the owning side to null (unless already changed)if ($plan->getPeriod() === $this) {$plan->setPeriod(null);}}return $this;}/*** @return Collection<int, Order>*/public function getOrders(): Collection{return $this->orders;}public function addOrder(Order $order): self{if (!$this->orders->contains($order)) {$this->orders->add($order);$order->setPeriod($this);}return $this;}public function removeOrder(Order $order): self{if ($this->orders->removeElement($order)) {// set the owning side to null (unless already changed)if ($order->getPeriod() === $this) {$order->setPeriod(null);}}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->setQuotaPeriod($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->getQuotaPeriod() === $this) {$ruleResult->setQuotaPeriod(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->setPeriod($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->getPeriod() === $this) {$commission->setPeriod(null);}}return $this;}/*** @return Collection<int, Credit>*/public function getCredits(): Collection{return $this->credits;}public function addCredit(Credit $credit): static{if (!$this->credits->contains($credit)) {$this->credits->add($credit);$credit->setPeriod($this);}return $this;}public function removeCredit(Credit $credit): static{if ($this->credits->removeElement($credit)) {// set the owning side to null (unless already changed)if ($credit->getPeriod() === $this) {$credit->setPeriod(null);}}return $this;}public function __toString(): string{return (string)$this->name;}}