src/Entity/NewsletterSubscriber.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Entity(repositoryClass="App\Repository\NewsletterSubscriberRepository")
  6.  *
  7.  * @ORM\HasLifecycleCallbacks()
  8.  */
  9. class NewsletterSubscriber
  10. {
  11.     public function __construct()
  12.     {
  13.     }
  14.     /**
  15.      * @ORM\Id()
  16.      *
  17.      * @ORM\GeneratedValue()
  18.      *
  19.      * @ORM\Column(type="integer")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @ORM\Column(type="string", nullable=false, length=180)
  24.      */
  25.     private $email null;
  26.     /**
  27.      * @ORM\Column(type="string", nullable=false, length=180)
  28.      */
  29.     private $hash null;
  30.     /**
  31.      * @ORM\Column(type="integer", nullable=false)
  32.      */
  33.     private $subscription_status 1;
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getEmail()
  39.     {
  40.         return $this->email;
  41.     }
  42.     public function setEmail($email)
  43.     {
  44.         $this->email $email;
  45.         return $this;
  46.     }
  47.     public function getHash()
  48.     {
  49.         return $this->hash;
  50.     }
  51.     public function setHash($hash)
  52.     {
  53.         $this->hash $hash;
  54.         return $this;
  55.     }
  56.     public function getSubscriptionStatus()
  57.     {
  58.         return $this->subscription_status;
  59.     }
  60.     public function setSubscriptionStatus($subscription_status)
  61.     {
  62.         $this->subscription_status $subscription_status;
  63.         return $this;
  64.     }
  65.     /**
  66.      * @ORM\Column(type="datetime", nullable=false)
  67.      */
  68.     private $created_at;
  69.     /**
  70.      * @ORM\Column(type="datetime", nullable=true)
  71.      */
  72.     private $updated_at null;
  73.     public function getCreatedAt(): \DateTimeInterface
  74.     {
  75.         return $this->created_at;
  76.     }
  77.     public function setCreatedAt(\DateTimeInterface $created_at): self
  78.     {
  79.         $this->created_at $created_at;
  80.         return $this;
  81.     }
  82.     public function getUpdatedAt(): ?\DateTimeInterface
  83.     {
  84.         return $this->updated_at;
  85.     }
  86.     public function setUpdatedAt(?\DateTimeInterface $updated_at): self
  87.     {
  88.         $this->updated_at $updated_at;
  89.         return $this;
  90.     }
  91.     /**
  92.      * @ORM\PrePersist
  93.      */
  94.     public function setCreatedAtValue()
  95.     {
  96.         $this->setCreatedAt(new \DateTime());
  97.     }
  98.     /**
  99.      * @ORM\PreUpdate
  100.      */
  101.     public function setUpdatedAtValue()
  102.     {
  103.         $this->setUpdatedAt(new \DateTime());
  104.     }
  105.     /**
  106.      * @ORM\Column(type="datetime", nullable=true)
  107.      */
  108.     private $deleted_at;
  109.     /**
  110.      * @ORM\ManyToOne(targetEntity="App\Entity\Newsletter", inversedBy="subscribers")
  111.      */
  112.     private $newsletter;
  113.     public function getDeletedAt(): ?\DateTimeInterface
  114.     {
  115.         return $this->deleted_at;
  116.     }
  117.     public function setDeletedAt(?\DateTimeInterface $deleted_at): self
  118.     {
  119.         $this->deleted_at $deleted_at;
  120.         return $this;
  121.     }
  122.     public function getNewsletter(): ?Newsletter
  123.     {
  124.         return $this->newsletter;
  125.     }
  126.     public function setNewsletter(?Newsletter $newsletter): self
  127.     {
  128.         $this->newsletter $newsletter;
  129.         return $this;
  130.     }
  131.     // Target of a LinkedEntity from NewsletterSubscriberController (Controller)
  132. }