src/Entity/Position.php line 13
<?phpnamespace App\Entity;use App\Repository\PositionRepository;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: PositionRepository::class)]class Position{use TimestampableEntity;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255, nullable: true)]private ?string $name = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $description = null;#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]private ?\DateTimeInterface $incentiveStartDate = null;#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]private ?\DateTimeInterface $incentiveEndDate = null;#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]private ?\DateTimeInterface $effectiveStartDate = null;#[ORM\ManyToOne(inversedBy: 'positions', fetch: 'EAGER')]private ?Title $title = null;#[ORM\ManyToOne(inversedBy: 'positions')]private ?User $user = null;#[ORM\OneToMany(mappedBy: 'position', targetEntity: Hierarchy::class, orphanRemoval: true)]private Collection $hierarchies;#[ORM\OneToMany(mappedBy: 'parentPosition', targetEntity: Hierarchy::class)]private Collection $parentHierarchies;#[ORM\OneToMany(mappedBy: 'position', targetEntity: QuotaAssignment::class)]private Collection $quotaAssignments;#[ORM\OneToMany(mappedBy: 'fromPosition', targetEntity: NamedRelationshipPosition::class)]private Collection $namedRelationshipPositions;#[ORM\OneToMany(mappedBy: 'toPosition', targetEntity: NamedRelationshipPosition::class)]private Collection $namedRelationshipPositionsTo;#[ORM\OneToMany(mappedBy: 'position', targetEntity: RuleCondition::class)]private Collection $ruleConditions;#[ORM\OneToMany(mappedBy: 'position', targetEntity: Commission::class)]private Collection $commissions;#[ORM\OneToMany(mappedBy: 'position', targetEntity: Credit::class)]private Collection $credits;#[ORM\OneToMany(mappedBy: 'position', targetEntity: LookUpTable::class)]private Collection $lookUpTables;public function __construct(){$this->hierarchies = new ArrayCollection();$this->parentHierarchies = new ArrayCollection();$this->quotaAssignments = new ArrayCollection();$this->namedRelationshipPositions = new ArrayCollection();$this->namedRelationshipPositionsTo = new ArrayCollection();$this->ruleConditions = new ArrayCollection();$this->commissions = new ArrayCollection();$this->credits = new ArrayCollection();$this->lookUpTables = 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;}public function getIncentiveStartDate(): ?\DateTimeInterface{return $this->incentiveStartDate;}public function setIncentiveStartDate(?\DateTimeInterface $incentiveStartDate): static{$this->incentiveStartDate = $incentiveStartDate;return $this;}public function getIncentiveEndDate(): ?\DateTimeInterface{return $this->incentiveEndDate;}public function setIncentiveEndDate(?\DateTimeInterface $incentiveEndDate): static{$this->incentiveEndDate = $incentiveEndDate;return $this;}public function getEffectiveStartDate(): ?\DateTimeInterface{return $this->effectiveStartDate;}public function setEffectiveStartDate(?\DateTimeInterface $effectiveStartDate): static{$this->effectiveStartDate = $effectiveStartDate;return $this;}public function getTitle(): ?Title{return $this->title;}public function setTitle(?Title $title): static{$this->title = $title;return $this;}public function getUser(): ?User{return $this->user;}public function setUser(?User $user): static{$this->user = $user;return $this;}/*** @return Collection<int, Hierarchy>*/public function getHierarchies(): Collection{return $this->hierarchies;}public function addHierarchy(Hierarchy $hierarchy): static{if (!$this->hierarchies->contains($hierarchy)) {$this->hierarchies->add($hierarchy);$hierarchy->setPosition($this);}return $this;}public function removeHierarchy(Hierarchy $hierarchy): static{if ($this->hierarchies->removeElement($hierarchy)) {// set the owning side to null (unless already changed)if ($hierarchy->getPosition() === $this) {$hierarchy->setPosition(null);}}return $this;}/*** @return Collection<int, Hierarchy>*/public function getParentHierarchies(): Collection{return $this->parentHierarchies;}public function addParentHierarchy(Hierarchy $parentHierarchy): static{if (!$this->parentHierarchies->contains($parentHierarchy)) {$this->parentHierarchies->add($parentHierarchy);$parentHierarchy->setParentPosition($this);}return $this;}public function removeParentHierarchy(Hierarchy $parentHierarchy): static{if ($this->parentHierarchies->removeElement($parentHierarchy)) {// set the owning side to null (unless already changed)if ($parentHierarchy->getParentPosition() === $this) {$parentHierarchy->setParentPosition(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->setPosition($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->getPosition() === $this) {$quotaAssignment->setPosition(null);}}return $this;}/*** @return Collection<int, NamedRelationshipPosition>*/public function getNamedRelationshipPositions(): Collection{return $this->namedRelationshipPositions;}public function addNamedRelationshipPosition(NamedRelationshipPosition $namedRelationshipPosition): self{if (!$this->namedRelationshipPositions->contains($namedRelationshipPosition)) {$this->namedRelationshipPositions->add($namedRelationshipPosition);$namedRelationshipPosition->setFromPosition($this);}return $this;}public function removeNamedRelationshipPosition(NamedRelationshipPosition $namedRelationshipPosition): self{if ($this->namedRelationshipPositions->removeElement($namedRelationshipPosition)) {// set the owning side to null (unless already changed)if ($namedRelationshipPosition->getFromPosition() === $this) {$namedRelationshipPosition->setFromPosition(null);}}return $this;}/*** @return Collection<int, NamedRelationshipPosition>*/public function getNamedRelationshipPositionsTo(): Collection{return $this->namedRelationshipPositionsTo;}public function addNamedRelationshipPositionsTo(NamedRelationshipPosition $namedRelationshipPositionsTo): self{if (!$this->namedRelationshipPositionsTo->contains($namedRelationshipPositionsTo)) {$this->namedRelationshipPositionsTo->add($namedRelationshipPositionsTo);$namedRelationshipPositionsTo->setToPosition($this);}return $this;}public function removeNamedRelationshipPositionsTo(NamedRelationshipPosition $namedRelationshipPositionsTo): self{if ($this->namedRelationshipPositionsTo->removeElement($namedRelationshipPositionsTo)) {// set the owning side to null (unless already changed)if ($namedRelationshipPositionsTo->getToPosition() === $this) {$namedRelationshipPositionsTo->setToPosition(null);}}return $this;}/*** @return Collection<int, RuleCondition>*/public function getRuleConditions(): Collection{return $this->ruleConditions;}public function addRuleCondition(RuleCondition $ruleCondition): self{if (!$this->ruleConditions->contains($ruleCondition)) {$this->ruleConditions->add($ruleCondition);$ruleCondition->setPosition($this);}return $this;}public function removeRuleCondition(RuleCondition $ruleCondition): self{if ($this->ruleConditions->removeElement($ruleCondition)) {// set the owning side to null (unless already changed)if ($ruleCondition->getPosition() === $this) {$ruleCondition->setPosition(null);}}return $this;}public function __toString(): string{return (string)$this->name;}/*** @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->setPosition($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->getPosition() === $this) {$commission->setPosition(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->setPosition($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->getPosition() === $this) {$credit->setPosition(null);}}return $this;}/*** @return Collection<int, LookUpTable>*/public function getLookUpTables(): Collection{return $this->lookUpTables;}public function addLookUpTable(LookUpTable $lookUpTable): static{if (!$this->lookUpTables->contains($lookUpTable)) {$this->lookUpTables->add($lookUpTable);$lookUpTable->setPosition($this);}return $this;}public function removeLookUpTable(LookUpTable $lookUpTable): static{if ($this->lookUpTables->removeElement($lookUpTable)) {// set the owning side to null (unless already changed)if ($lookUpTable->getPosition() === $this) {$lookUpTable->setPosition(null);}}return $this;}}