src/Entity/Subscription.php line 12
<?phpnamespace App\Entity;use App\Repository\SubscriptionRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: SubscriptionRepository::class)]class Subscription{const STATUS_PENDING = 'pending';const STATUS_PAID = 'paid';const STATUS_DELIVERED = 'complete';const STATUS_CANCELLED = 'cancelled';#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255, nullable: true)]private ?string $firstName = null;#[ORM\Column(length: 255, nullable: true)]private ?string $lastName = null;#[ORM\Column(length: 255, nullable: true)]private ?string $place = null;#[ORM\Column(length: 255, nullable: true)]private ?string $postalCode = null;#[ORM\Column(length: 255, nullable: true)]private ?string $city = null;#[ORM\Column(length: 255, nullable: true)]private ?string $country = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $additionnal = null;#[ORM\Column(length: 255, nullable: true)]private ?string $phone = null;#[ORM\Column(length: 255)]private ?string $payment_type = null;#[ORM\Column(length: 50, nullable: true)]private ?string $status = self::STATUS_PENDING;#[ORM\Column(nullable: true)]private ?float $amount = null;#[ORM\Column(length: 120, nullable: true)]private ?string $coupon_code = null;#[ORM\Column(nullable: true)]private ?float $discount_amount = null;#[ORM\Column(nullable: true)]private ?float $sub_total = null;#[ORM\Column(nullable: true)]private ?string $is_confirmed = null;#[ORM\OneToMany(mappedBy: 'subscription', targetEntity: SubscriptionProduct::class)]private Collection $subscriptionProducts;#[ORM\Column(length: 15)]private ?string $reference = null;#[ORM\ManyToOne(inversedBy: 'subscriptions')]private ?User $user = null;#[ORM\Column(type: Types::DATETIME_MUTABLE)]private ?\DateTimeInterface $createAt = null;public function __construct(){$this->subscriptionProducts = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getFirstName(): ?string{return $this->firstName;}public function setFirstName(?string $firstName): self{$this->firstName = $firstName;return $this;}public function getLastName(): ?string{return $this->lastName;}public function setLastName(?string $lastName): self{$this->lastName = $lastName;return $this;}public function getPlace(): ?string{return $this->place;}public function setPlace(?string $place): self{$this->place = $place;return $this;}public function getPostalCode(): ?string{return $this->postalCode;}public function setPostalCode(?string $postalCode): self{$this->postalCode = $postalCode;return $this;}public function getCity(): ?string{return $this->city;}public function setCity(?string $city): self{$this->city = $city;return $this;}public function getCountry(): ?string{return $this->country;}public function setCountry(?string $country): self{$this->country = $country;return $this;}public function getAdditionnal(): ?string{return $this->additionnal;}public function setAdditionnal(?string $additionnal): self{$this->additionnal = $additionnal;return $this;}public function getPhone(): ?string{return $this->phone;}public function setPhone(?string $phone): self{$this->phone = $phone;return $this;}public function getPaymentType(): ?string{return $this->payment_type;}public function setPaymentType(string $payment_type): self{$this->payment_type = $payment_type;return $this;}public function getStatus(): ?string{return $this->status;}public function setStatus(?string $status): self{$this->status = $status;return $this;}public function getAmount(): ?float{return $this->amount;}public function setAmount(?float $amount): self{$this->amount = $amount;return $this;}public function getCouponCode(): ?string{return $this->coupon_code;}public function setCouponCode(?string $coupon_code): self{$this->coupon_code = $coupon_code;return $this;}public function getDiscountAmount(): ?float{return $this->discount_amount;}public function setDiscountAmount(?float $discount_amount): self{$this->discount_amount = $discount_amount;return $this;}public function getSubTotal(): ?float{return $this->sub_total;}public function setSubTotal(?float $sub_total): self{$this->sub_total = $sub_total;return $this;}public function isIsConfirmed(): ?string{return $this->is_confirmed;}public function setIsConfirmed(?string $is_confirmed): self{$this->is_confirmed = $is_confirmed;return $this;}/*** @return Collection<int, SubscriptionProduct>*/public function getSubscriptionProducts(): Collection{return $this->subscriptionProducts;}public function addSubscriptionProduct(SubscriptionProduct $subscriptionProduct): self{if (!$this->subscriptionProducts->contains($subscriptionProduct)) {$this->subscriptionProducts->add($subscriptionProduct);$subscriptionProduct->setSubscription($this);}return $this;}public function removeSubscriptionProduct(SubscriptionProduct $subscriptionProduct): self{if ($this->subscriptionProducts->removeElement($subscriptionProduct)) {// set the owning side to null (unless already changed)if ($subscriptionProduct->getSubscription() === $this) {$subscriptionProduct->setSubscription(null);}}return $this;}public function getReference(): ?string{return $this->reference;}public function setReference(string $reference): self{$this->reference = $reference;return $this;}public function getUser(): ?User{return $this->user;}public function setUser(?User $user): self{$this->user = $user;return $this;}public function getCreateAt(): ?\DateTimeInterface{return $this->createAt;}public function setCreateAt(\DateTimeInterface $createAt): self{$this->createAt = $createAt;return $this;}}