src/Entity/ArticleTag.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\ArticleTagRepository")
  6.  *
  7.  * @ORM\HasLifecycleCallbacks()
  8.  */
  9. class ArticleTag
  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.     public function getId(): ?int
  23.     {
  24.         return $this->id;
  25.     }
  26.     /**
  27.      * @ORM\Column(type="datetime", nullable=false)
  28.      */
  29.     private $created_at;
  30.     /**
  31.      * @ORM\Column(type="datetime", nullable=true)
  32.      */
  33.     private $updated_at null;
  34.     public function getCreatedAt(): \DateTimeInterface
  35.     {
  36.         return $this->created_at;
  37.     }
  38.     public function setCreatedAt(\DateTimeInterface $created_at): self
  39.     {
  40.         $this->created_at $created_at;
  41.         return $this;
  42.     }
  43.     public function getUpdatedAt(): ?\DateTimeInterface
  44.     {
  45.         return $this->updated_at;
  46.     }
  47.     public function setUpdatedAt(?\DateTimeInterface $updated_at): self
  48.     {
  49.         $this->updated_at $updated_at;
  50.         return $this;
  51.     }
  52.     /**
  53.      * @ORM\PrePersist
  54.      */
  55.     public function setCreatedAtValue()
  56.     {
  57.         $this->setCreatedAt(new \DateTime());
  58.     }
  59.     /**
  60.      * @ORM\PreUpdate
  61.      */
  62.     public function setUpdatedAtValue()
  63.     {
  64.         $this->setUpdatedAt(new \DateTime());
  65.     }
  66.     /**
  67.      * @ORM\Column(type="datetime", nullable=true)
  68.      */
  69.     private $deleted_at;
  70.     public function getDeletedAt(): ?\DateTimeInterface
  71.     {
  72.         return $this->deleted_at;
  73.     }
  74.     public function setDeletedAt(?\DateTimeInterface $deleted_at): self
  75.     {
  76.         $this->deleted_at $deleted_at;
  77.         return $this;
  78.     }
  79.     /**
  80.      * @ORM\ManyToOne(targetEntity="App\Entity\Article", inversedBy="article_tags")
  81.      *
  82.      * @ORM\JoinColumn(nullable=false)
  83.      */
  84.     private $article;
  85.     public function getArticle(): ?Article
  86.     {
  87.         return $this->article;
  88.     }
  89.     public function setArticle(?Article $article): self
  90.     {
  91.         $this->article $article;
  92.         return $this;
  93.     }
  94.     /**
  95.      * @ORM\ManyToOne(targetEntity="App\Entity\Tag", inversedBy="article_tags")
  96.      *
  97.      * @ORM\JoinColumn(nullable=false)
  98.      */
  99.     private $tag;
  100.     public function getTag(): ?Tag
  101.     {
  102.         return $this->tag;
  103.     }
  104.     public function setTag(?Tag $tag): self
  105.     {
  106.         $this->tag $tag;
  107.         return $this;
  108.     }
  109. }