src/Entity/FormationRegistration.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FormationRegistrationRepository;
  4. use DateTime;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass=FormationRegistrationRepository::class)
  8.  * @ORM\HasLifecycleCallbacks()
  9.  */
  10. class FormationRegistration
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="formations")
  20.      * @ORM\JoinColumn(nullable=false)
  21.      */
  22.     private $User;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity=Formation::class, inversedBy="registration")
  25.      *  @ORM\JoinColumn(name="formation_id",referencedColumnName="id",onDelete="CASCADE",nullable=false)
  26.      */
  27.     private $formation;
  28.     /**
  29.      * @ORM\Column(type="datetime", nullable=true, options={"default": "CURRENT_TIMESTAMP"})
  30.      */
  31.     private $createdAt;
  32.     /**
  33.      * @ORM\Column(type="datetime", nullable=true, options={"default": "CURRENT_TIMESTAMP"})
  34.      */
  35.     private $updatedAt;
  36.     /**
  37.      * @ORM\Column(type="integer")
  38.      */
  39.     private $viewed=0;
  40.     /**
  41.      * @ORM\Column(type="datetime", nullable=true, options={"default": "CURRENT_TIMESTAMP"})
  42.      */
  43.     private $viewedAt;
  44.     /**
  45.      * @ORM\Column(type="integer")
  46.      */
  47.     private $opened=0;
  48.     /**
  49.      * @ORM\Column(type="datetime", nullable=true)
  50.      */
  51.     private $openedAt;
  52.     /**
  53.      * @ORM\Column(type="integer",options={"default": 1})
  54.      */
  55.     private $visible=1;
  56.     /**
  57.      * @ORM\Column(type="integer",options={"default": 1})
  58.      */
  59.     private $emailSent=0;
  60.     public function getId(): ?int
  61.     {
  62.         return $this->id;
  63.     }
  64.     public function getUser(): ?User
  65.     {
  66.         return $this->User;
  67.     }
  68.     public function setUser(?User $User): self
  69.     {
  70.         $this->User $User;
  71.         return $this;
  72.     }
  73.     public function getFormation(): ?Formation
  74.     {
  75.         return $this->formation;
  76.     }
  77.     public function setFormation(?Formation $formation): self
  78.     {
  79.         $this->formation $formation;
  80.         return $this;
  81.     }
  82.     public function getUpdatedAt() :?DateTime
  83.     {
  84.         return $this->updatedAt;
  85.     }
  86.     public function setUpdatedAt(DateTime $updatedAt): self
  87.     {
  88.         $this->updatedAt $updatedAt;
  89.         return $this;
  90.     }
  91.     public function getCreatedAt() :?DateTime
  92.     {
  93.         return $this->createdAt;
  94.     }
  95.     public function setCreatedAt(DateTime $createdAt): self
  96.     {
  97.         $this->createdAt $createdAt;
  98.         return $this;
  99.     }
  100.     /**
  101.      * @ORM\PrePersist
  102.      * @ORM\PreUpdate
  103.      */
  104.     public function updatedTimestamps(): void
  105.     {
  106.         $dateTimeNow = new \DateTime("now", new \DateTimeZone("Europe/Paris"));
  107.         $this->setUpdatedAt($dateTimeNow);
  108.         if ($this->getCreatedAt() === null) {
  109.             $this->setCreatedAt($dateTimeNow);
  110.         }
  111.     }
  112.     /**
  113.      * @return mixed
  114.      */
  115.     public function getViewed()
  116.     {
  117.         return $this->viewed;
  118.     }
  119.     /**
  120.      * @param mixed $viewed
  121.      */
  122.     public function setViewed($viewed): void
  123.     {
  124.         $this->viewed $viewed;
  125.     }
  126.     /**
  127.      * @return mixed
  128.      */
  129.     public function getViewedAt()
  130.     {
  131.         return $this->viewedAt;
  132.     }
  133.     /**
  134.      * @param mixed $viewedAt
  135.      */
  136.     public function setViewedAt($viewedAt): void
  137.     {
  138.         $this->viewedAt $viewedAt;
  139.     }
  140.     /**
  141.      * @return int
  142.      */
  143.     public function getOpened(): int
  144.     {
  145.         return $this->opened;
  146.     }
  147.     /**
  148.      * @param int $opened
  149.      */
  150.     public function setOpened(int $opened): void
  151.     {
  152.         $this->opened $opened;
  153.     }
  154.     /**
  155.      * @return mixed
  156.      */
  157.     public function getOpenedAt()
  158.     {
  159.         return $this->openedAt;
  160.     }
  161.     /**
  162.      * @param mixed $openedAt
  163.      */
  164.     public function setOpenedAt($openedAt): void
  165.     {
  166.         $this->openedAt $openedAt;
  167.     }
  168.     /**
  169.      * @return int
  170.      */
  171.     public function getVisible(): int
  172.     {
  173.         return $this->visible;
  174.     }
  175.     /**
  176.      * @param int $visible
  177.      */
  178.     public function setVisible(int $visible): void
  179.     {
  180.         $this->visible $visible;
  181.     }
  182.     /**
  183.      * @return int
  184.      */
  185.     public function getEmailSent(): int
  186.     {
  187.         return $this->emailSent;
  188.     }
  189.     /**
  190.      * @param int $emailSent
  191.      */
  192.     public function setEmailSent(int $emailSent): void
  193.     {
  194.         $this->emailSent $emailSent;
  195.     }
  196. }