src/Modules/RecommendationVoucherForm/Entity/RecommendationVoucherForm.php line 16
<?phpnamespace App\Modules\RecommendationVoucherForm\Entity;use App\Admin\Modules\Voucher\Entity\VoucherPackageVoucher;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Gedmo\Mapping\Annotation as Gedmo;/*** @ORM\Table(name="recommendation_voucher_form", uniqueConstraints={@ORM\UniqueConstraint(columns={"id_voucher_package_voucher"})})* @ORM\Entity*/class RecommendationVoucherForm{/*** @ORM\Column(type="bigint", options={"unsigned"=true}))* @ORM\Id* @ORM\GeneratedValue(strategy="AUTO")*/private $id;/*** @ORM\ManyToOne(targetEntity="App\Admin\Modules\Voucher\Entity\VoucherPackageVoucher", inversedBy="recommendationVoucherForm")* @ORM\JoinColumns({* @ORM\JoinColumn(name="id_voucher_package_voucher", referencedColumnName="id", nullable=false, onDelete="CASCADE")* })*/private $voucher;/*** @ORM\Column(name="added_at", type="datetime", nullable=false)* @Gedmo\Timestampable(on="create")*/private $addedAt;/*** @ORM\OneToMany(targetEntity="App\Modules\RecommendationVoucherForm\Entity\RecommendationVoucherFormField", mappedBy="form", cascade={"persist"}, orphanRemoval=true)* @ORM\OrderBy({"id"="ASC"})*/private $formFields;/*** @ORM\ManyToMany(targetEntity="App\Admin\Modules\Voucher\Entity\VoucherPackageVoucher")* @ORM\JoinTable(name="recommendation_voucher_form_voucher",* joinColumns={@ORM\JoinColumn(name="recommendation_voucher_form", referencedColumnName="id", onDelete="CASCADE")},* inverseJoinColumns={@ORM\JoinColumn(name="id_voucher_package_voucher", referencedColumnName="id", onDelete="CASCADE")}* )* @ORM\OrderBy({"id"="ASC"})**/private $vouchers;public function __construct(){$this->formFields = new ArrayCollection();$this->vouchers = new ArrayCollection();}public function getId(): ?string{return $this->id;}public function getAddedAt(): ?\DateTimeInterface{return $this->addedAt;}public function setAddedAt(\DateTimeInterface $addedAt): self{$this->addedAt = $addedAt;return $this;}public function getVoucher(): ?VoucherPackageVoucher{return $this->voucher;}public function setVoucher(?VoucherPackageVoucher $voucher): self{$this->voucher = $voucher;return $this;}/*** @return Collection<int, RecommendationVoucherFormField>*/public function getFormFields(): Collection{return $this->formFields;}public function addFormField(RecommendationVoucherFormField $formField): self{if (!$this->formFields->contains($formField)) {$this->formFields->add($formField);$formField->setForm($this);}return $this;}public function removeFormField(RecommendationVoucherFormField $formField): self{if ($this->formFields->removeElement($formField)) {// set the owning side to null (unless already changed)if ($formField->getForm() === $this) {$formField->setForm(null);}}return $this;}/*** @return Collection<int, VoucherPackageVoucher>*/public function getVouchers(): Collection{return $this->vouchers;}public function addVoucher(VoucherPackageVoucher $voucher): self{if (!$this->vouchers->contains($voucher)) {$this->vouchers->add($voucher);}return $this;}public function removeVoucher(VoucherPackageVoucher $voucher): self{$this->vouchers->removeElement($voucher);return $this;}}