src/Modules/VoucherCart/Entity/VoucherOrderVoucher.php line 16
<?phpnamespace App\Modules\VoucherCart\Entity;use App\Admin\Modules\Voucher\Entity\VoucherPackage;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;/*** @ORM\Table(name="voucher_order_voucher", indexes={@ORM\Index(columns={"name"}), @ORM\Index(columns={"type"}), @ORM\Index(columns={"price"}), @ORM\Index(columns={"total_price"})})* @ORM\Entity*/class VoucherOrderVoucher{const TYPE_AMOUNT = 1;const TYPE_PREDEFINED = 2;/*** @var int** @ORM\Id* @ORM\Column(type="bigint", options={"unsigned"=true}))* @ORM\GeneratedValue(strategy="AUTO")*/private $id;/*** @var \App\Modules\VoucherCart\Entity\VoucherOrder** @ORM\ManyToOne(targetEntity="App\Modules\VoucherCart\Entity\VoucherOrder", inversedBy="vouchers")* @ORM\JoinColumns({* @ORM\JoinColumn(name="id_voucher_order", referencedColumnName="id", nullable=false, onDelete="CASCADE")* })*/private $order;/*** @var \App\Admin\Modules\Voucher\Entity\VoucherPackage** @ORM\ManyToOne(targetEntity="App\Admin\Modules\Voucher\Entity\VoucherPackage")* @ORM\JoinColumns({* @ORM\JoinColumn(name="id_voucher_package", referencedColumnName="id", nullable=true, onDelete="SET NULL")* })*/private $package;/*** @var string** @ORM\Column(name="name", type="string", length=255, nullable=true, options={"collation"="utf8_unicode_ci"})*/private $name;/*** @var int** @ORM\Column(name="type", type="smallint", nullable=false)*/private $type;/*** @var string** @ORM\Column(name="value", type="decimal", precision=14, scale=2, nullable=false)*/private $value;/*** @var string** @ORM\Column(name="gift_for", type="string", length=255, nullable=true)*/private $giftFor;/*** @var string** @ORM\Column(name="gift_from", type="string", length=255, nullable=true)*/private $giftFrom;/*** @var string** @ORM\Column(name="gift_message", type="string", length=4096, nullable=true)*/private $giftMessage;/*** @var string** @ORM\Column(name="price", type="decimal", precision=14, scale=2, nullable=false)*/private $price;/*** @var int** @ORM\Column(name="quantity", type="integer", nullable=false)*/private $quantity;/*** @var string** @ORM\Column(name="total_price", type="decimal", precision=14, scale=2, nullable=false)*/private $totalPrice;/*** @var \App\Admin\Modules\Voucher\Entity\VoucherPackageVoucher** @ORM\ManyToMany(targetEntity="App\Admin\Modules\Voucher\Entity\VoucherPackageVoucher", inversedBy="orderVoucher")* @ORM\JoinTable(name="voucher_order_voucher_package_voucher",* joinColumns={@ORM\JoinColumn(name="id_voucher_order_voucher", referencedColumnName="id", onDelete="CASCADE")},* inverseJoinColumns={@ORM\JoinColumn(name="id_vouhcer_package_voucher", referencedColumnName="id", onDelete="CASCADE")}* )**/private $packageVouchers;public function __construct(){$this->packageVouchers = new ArrayCollection();}public function getId(): ?string{return $this->id;}public function getType(): ?int{return $this->type;}public function setType(int $type): self{$this->type = $type;return $this;}public function getName(): ?string{return $this->name;}public function setName(?string $name): self{$this->name = $name;return $this;}public function getValue(): ?string{return $this->value;}public function setValue(string $value): self{$this->value = $value;return $this;}public function getPrice(): ?string{return $this->price;}public function setPrice(string $price): self{$this->price = $price;return $this;}public function getOrder(): ?VoucherOrder{return $this->order;}public function setOrder(?VoucherOrder $order): self{$this->order = $order;return $this;}public function getQuantity(): ?int{return $this->quantity;}public function setQuantity(int $quantity): self{$this->quantity = $quantity;return $this;}public function getTotalPrice(): ?string{return $this->totalPrice;}public function setTotalPrice(string $totalPrice): self{$this->totalPrice = $totalPrice;return $this;}public function getPackage(): ?VoucherPackage{return $this->package;}public function setPackage(?VoucherPackage $package): self{$this->package = $package;return $this;}/*** @return Collection<int, VoucherPackageVoucher>*/public function getPackageVouchers(): Collection{return $this->packageVouchers;}public function addPackageVoucher(VoucherPackageVoucher $packageVoucher): self{if (!$this->packageVouchers->contains($packageVoucher)) {$this->packageVouchers->add($packageVoucher);}return $this;}public function removePackageVoucher(VoucherPackageVoucher $packageVoucher): self{$this->packageVouchers->removeElement($packageVoucher);return $this;}public function getGiftFrom(): ?string{return $this->giftFrom;}public function setGiftFrom(?string $giftFrom): self{$this->giftFrom = $giftFrom;return $this;}public function getGiftFor(): ?string{return $this->giftFor;}public function setGiftFor(?string $giftFor): self{$this->giftFor = $giftFor;return $this;}public function getGiftMessage(): ?string{return $this->giftMessage;}public function setGiftMessage(?string $giftMessage): self{$this->giftMessage = $giftMessage;return $this;}}