*/ #[ORM\OneToMany(targetEntity: PreferenceOption::class, mappedBy: 'preference', fetch: 'EAGER')] private Collection $preferenceOptions; public function __construct() { $this->preferenceOptions = new ArrayCollection(); } public function getId(): ?string { return $this->id; } public function getName(): ?string { return $this->name; } public function setId(string $id): static { $this->id = $id; return $this; } 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 isEnabled(): ?bool { return $this->enabled; } public function setEnabled(bool $enabled): static { $this->enabled = $enabled; return $this; } /** * @return Collection */ public function getPreferenceOptions(): Collection { return $this->preferenceOptions; } public function addPreferenceOption(PreferenceOption $preferenceOption): static { if (!$this->preferenceOptions->contains($preferenceOption)) { $this->preferenceOptions->add($preferenceOption); $preferenceOption->setPreference($this); } return $this; } public function removePreferenceOption(PreferenceOption $preferenceOption): static { if ($this->preferenceOptions->removeElement($preferenceOption)) { // set the owning side to null (unless already changed) if ($preferenceOption->getPreference() === $this) { $preferenceOption->setPreference(null); } } return $this; } }