<?php namespace App\Entity; use App\Repository\SubscriptionRepository; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity(repositoryClass=SubscriptionRepository::class) */ class Subscription { /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private ?int $id = NULL; /** * @ORM\OneToMany(targetEntity=UserSubscription::class, mappedBy="subscription", cascade={"remove"}) */ private Collection $userSubscriptions; /** * @ORM\Column(type="string", length=255) */ private ?string $name = NULL; /** * @ORM\Column(type="integer") */ private ?int $monthDuration = NULL; /** * @ORM\Column(type="boolean") */ private bool $isDefault = FALSE; public function __toString() { return $this->getName(); } 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 getMonthDuration(): ?int { return $this->monthDuration; } public function setMonthDuration(int $monthDuration): self { $this->monthDuration = $monthDuration; return $this; } public function isIsDefault(): ?bool { return $this->isDefault; } public function setIsDefault(bool $isDefault): self { $this->isDefault = $isDefault; return $this; } /** * @return Collection */ public function getUserSubscriptions(): Collection { return $this->userSubscriptions; } /** * @param Collection $userSubscriptions */ public function setUserSubscriptions(Collection $userSubscriptions): void { $this->userSubscriptions = $userSubscriptions; } }