src/Entity/Tenant/Renewal.php line 15

  1. <?php
  2. namespace App\Entity\Tenant;
  3. use ApiPlatform\Metadata\ApiFilter;
  4. use ApiPlatform\Metadata\ApiResource;
  5. use App\Repository\Tenant\RenewalRepository;
  6. use App\Service\ApiPlatform\GeneralSearchFilter;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ApiResource]
  10. #[ApiFilter(GeneralSearchFilter::class)]
  11. #[ORM\Entity(repositoryClassRenewalRepository::class)]
  12. class Renewal
  13. {
  14.     /**
  15.      * visible :list;order:1;
  16.      */
  17.     #[ORM\Id]
  18.     #[ORM\GeneratedValue]
  19.     #[ORM\Column]
  20.     private ?int $id null;
  21.     /**
  22.      * visible :list;order:1;
  23.      */
  24.     #[ORM\Column]
  25.     private ?\DateTimeImmutable $createdAt null;
  26.     /**
  27.      * visible :list;order:1;
  28.      */
  29.     #[ORM\Column]
  30.     private ?\DateTimeImmutable $updatedAt null;
  31.     /**
  32.      * visible :list, form;order:4;
  33.      */
  34.     #[ORM\Column]
  35.     private ?bool $completed null;
  36.     /**
  37.      * visible :list, form;order:2;
  38.      */
  39.     #[ORM\Column(length255)]
  40.     private ?string $plan null;
  41.     // TODO: relacionar payments
  42.     /**
  43.      * visible :list, form;order:3;manyToOne:true
  44.      */
  45.     #[ORM\ManyToOne(inversedBy'renewals')]
  46.     #[ORM\JoinColumn(nullablefalse)]
  47.     private ?Subscription $subscription null;
  48.     public function __construct()
  49.     {
  50.         $this->payments = new ArrayCollection();
  51.     }
  52.     public function getId(): ?int
  53.     {
  54.         return $this->id;
  55.     }
  56.     public function getCreatedAt(): ?\DateTimeImmutable
  57.     {
  58.         return $this->createdAt;
  59.     }
  60.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  61.     {
  62.         $this->createdAt $createdAt;
  63.         return $this;
  64.     }
  65.     public function getUpdatedAt(): ?\DateTimeImmutable
  66.     {
  67.         return $this->updatedAt;
  68.     }
  69.     public function setUpdatedAt(\DateTimeImmutable $updatedAt): self
  70.     {
  71.         $this->updatedAt $updatedAt;
  72.         return $this;
  73.     }
  74.     public function isCompleted(): ?bool
  75.     {
  76.         return $this->completed;
  77.     }
  78.     public function setCompleted(bool $completed): self
  79.     {
  80.         $this->completed $completed;
  81.         return $this;
  82.     }
  83.     public function getPlan(): ?string
  84.     {
  85.         return $this->plan;
  86.     }
  87.     public function setPlan(string $plan): self
  88.     {
  89.         $this->plan $plan;
  90.         return $this;
  91.     }
  92.     public function getSubscription(): ?Subscription
  93.     {
  94.         return $this->subscription;
  95.     }
  96.     public function setSubscription(?Subscription $subscription): self
  97.     {
  98.         $this->subscription $subscription;
  99.         return $this;
  100.     }
  101. }