src/Entity/Comment.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CommentRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass=CommentRepository::class)
  8.  */
  9. class Comment
  10. {
  11.     public function __construct()
  12.     {
  13.         $this->createdAt =  new \Datetime();
  14.         $this->isEnabled false;
  15.     }
  16.     /**
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue
  19.      * @ORM\Column(type="integer")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @ORM\Column(type="datetime")
  24.      */
  25.     private $createdAt;
  26.     /**
  27.      * @ORM\Column(type="string", length=255)
  28.      */
  29.     private $content;
  30.     /**
  31.      * @ORM\Column(type="boolean")
  32.      */
  33.     private $isEnabled;
  34.     /**
  35.      * @ORM\ManyToOne(targetEntity=Masjid::class, inversedBy="comments")
  36.      * @ORM\JoinColumn(nullable=false)
  37.      */
  38.     private $masjid;
  39.     /**
  40.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="comments")
  41.      * @ORM\JoinColumn(nullable=false)
  42.      */
  43.     private $Author;
  44.     public function getId(): ?int
  45.     {
  46.         return $this->id;
  47.     }
  48.     public function getCreatedAt(): ?\DateTimeInterface
  49.     {
  50.         return $this->createdAt;
  51.     }
  52.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  53.     {
  54.         $this->createdAt $createdAt;
  55.         return $this;
  56.     }
  57.     public function getContent(): ?string
  58.     {
  59.         return $this->content;
  60.     }
  61.     public function setContent(string $content): self
  62.     {
  63.         $this->content $content;
  64.         return $this;
  65.     }
  66.     public function getIsEnabled(): ?bool
  67.     {
  68.         return $this->isEnabled;
  69.     }
  70.     public function setIsEnabled(bool $isEnabled): self
  71.     {
  72.         $this->isEnabled $isEnabled;
  73.         return $this;
  74.     }
  75.     public function getMasjid(): ?Masjid
  76.     {
  77.         return $this->masjid;
  78.     }
  79.     public function setMasjid(?Masjid $masjid): self
  80.     {
  81.         $this->masjid $masjid;
  82.         return $this;
  83.     }
  84.     public function getAuthor(): ?User
  85.     {
  86.         return $this->Author;
  87.     }
  88.     public function setAuthor(?User $Author): self
  89.     {
  90.         $this->Author $Author;
  91.         return $this;
  92.     }
  93. }