src/Entity/Title.php line 13
<?phpnamespace App\Entity;use App\Repository\TitleRepository;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: TitleRepository::class)]class Title{use TimestampableEntity;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\ManyToOne(inversedBy: 'titles')]#[ORM\JoinColumn(nullable: true)]private ?Year $year = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $description = null;#[ORM\OneToMany(mappedBy: 'title', targetEntity: Position::class)]private Collection $positions;#[ORM\OneToMany(mappedBy: 'title', targetEntity: QuotaAssignment::class)]private Collection $quotaAssignments;#[ORM\OneToMany(mappedBy: 'title', targetEntity: User::class)]private Collection $users;#[ORM\OneToMany(mappedBy: 'title', targetEntity: RateTableAssignment::class)]private Collection $rateTableAssignments;#[ORM\OneToMany(mappedBy: 'title', targetEntity: PlanAssignment::class)]private Collection $planAssignments;#[ORM\ManyToMany(targetEntity: Message::class, mappedBy: 'titles')]private Collection $messages;#[ORM\Column]private ?bool $displayOnPayrollReportFilter = false;public function __construct(){$this->positions = new ArrayCollection();$this->quotaAssignments = new ArrayCollection();$this->users = new ArrayCollection();$this->rateTableAssignments = new ArrayCollection();$this->planAssignments = new ArrayCollection();$this->messages = 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 __toString(){return (string)$this->name;}public function getYear(): ?Year{return $this->year;}public function setYear(?Year $year): self{$this->year = $year;return $this;}public function getDescription(): ?string{return $this->description;}public function setDescription(?string $description): static{$this->description = $description;return $this;}/*** @return Collection<int, Position>*/public function getPositions(): Collection{return $this->positions;}public function addPosition(Position $position): static{if (!$this->positions->contains($position)) {$this->positions->add($position);$position->setTitle($this);}return $this;}public function removePosition(Position $position): static{if ($this->positions->removeElement($position)) {// set the owning side to null (unless already changed)if ($position->getTitle() === $this) {$position->setTitle(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->setTitle($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->getTitle() === $this) {$quotaAssignment->setTitle(null);}}return $this;}/*** @return Collection<int, User>*/public function getUsers(): Collection{return $this->users;}public function addUser(User $user): static{if (!$this->users->contains($user)) {$this->users->add($user);$user->setTitle($this);}return $this;}public function removeUser(User $user): static{if ($this->users->removeElement($user)) {// set the owning side to null (unless already changed)if ($user->getTitle() === $this) {$user->setTitle(null);}}return $this;}/*** @return Collection<int, RateTableAssignment>*/public function getRateTableAssignments(): Collection{return $this->rateTableAssignments;}public function addRateTableAssignment(RateTableAssignment $rateTableAssignment): static{if (!$this->rateTableAssignments->contains($rateTableAssignment)) {$this->rateTableAssignments->add($rateTableAssignment);$rateTableAssignment->setTitle($this);}return $this;}public function removeRateTableAssignment(RateTableAssignment $rateTableAssignment): static{if ($this->rateTableAssignments->removeElement($rateTableAssignment)) {// set the owning side to null (unless already changed)if ($rateTableAssignment->getTitle() === $this) {$rateTableAssignment->setTitle(null);}}return $this;}/*** @return Collection<int, PlanAssignment>*/public function getPlanAssignments(): Collection{return $this->planAssignments;}public function addPlanAssignment(PlanAssignment $planAssignment): static{if (!$this->planAssignments->contains($planAssignment)) {$this->planAssignments->add($planAssignment);$planAssignment->setTitle($this);}return $this;}public function removePlanAssignment(PlanAssignment $planAssignment): static{if ($this->planAssignments->removeElement($planAssignment)) {// set the owning side to null (unless already changed)if ($planAssignment->getTitle() === $this) {$planAssignment->setTitle(null);}}return $this;}/*** @return Collection<int, Message>*/public function getMessages(): Collection{return $this->messages;}public function addMessage(Message $message): static{if (!$this->messages->contains($message)) {$this->messages->add($message);$message->addTitle($this);}return $this;}public function removeMessage(Message $message): static{if ($this->messages->removeElement($message)) {$message->removeTitle($this);}return $this;}public function isDisplayOnPayrollReportFilter(): ?bool{return $this->displayOnPayrollReportFilter;}public function setDisplayOnPayrollReportFilter(bool $displayOnPayrollReportFilter): static{$this->displayOnPayrollReportFilter = $displayOnPayrollReportFilter;return $this;}}