src/Entity/NewArticle.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\NewArticleRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use DateTime;
  6. /**
  7.  * @ORM\Entity(repositoryClass=NewArticleRepository::class)
  8.  */
  9. class NewArticle
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\ManyToOne(targetEntity=Articles::class, inversedBy="newArticles")
  19.      * @ORM\JoinColumn(nullable=false)
  20.      */
  21.     private $article;
  22.     /**
  23.      * @ORM\Column(type="datetime")
  24.      */
  25.     private $createdAt;
  26.     /**
  27.      * @ORM\Column(type="boolean")
  28.      */
  29.     private $deleted false;
  30.     /**
  31.      * @ORM\Column(type="datetime")
  32.      */
  33.     private $start;
  34.     /**
  35.      * @ORM\Column(type="datetime")
  36.      */
  37.     private $end;
  38.     public function __construct()
  39.     {
  40.         $this->createdAt = new DateTime();
  41.     }
  42.     public function getId(): ?int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getArticle(): ?Articles
  47.     {
  48.         return $this->article;
  49.     }
  50.     public function setArticle(?Articles $article): self
  51.     {
  52.         $this->article $article;
  53.         return $this;
  54.     }
  55.     public function getCreatedAt(): ?\DateTimeInterface
  56.     {
  57.         return $this->createdAt;
  58.     }
  59.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  60.     {
  61.         $this->createdAt $createdAt;
  62.         return $this;
  63.     }
  64.     public function isDeleted(): ?bool
  65.     {
  66.         return $this->deleted;
  67.     }
  68.     public function setDeleted(bool $deleted): self
  69.     {
  70.         $this->deleted $deleted;
  71.         return $this;
  72.     }
  73.     public function getStart(): ?\DateTimeInterface
  74.     {
  75.         return $this->start;
  76.     }
  77.     public function setStart(\DateTimeInterface $start): self
  78.     {
  79.         $this->start $start;
  80.         return $this;
  81.     }
  82.     public function getEnd(): ?\DateTimeInterface
  83.     {
  84.         return $this->end;
  85.     }
  86.     public function setEnd(\DateTimeInterface $end): self
  87.     {
  88.         $this->end $end;
  89.         return $this;
  90.     }
  91. }