src/Entity/FreelancerComment.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FreelancerCommentRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. /**
  7.  * @ORM\Entity(repositoryClass=FreelancerCommentRepository::class)
  8.  */
  9. class FreelancerComment
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\ManyToOne(targetEntity=Freelancer::class, inversedBy="comments")
  19.      * @ORM\JoinColumn(nullable=false)
  20.      */
  21.     private $freelancer;
  22.     /**
  23.      * @ORM\Column(type="datetime")
  24.      * @Gedmo\Timestampable(on="update")
  25.      */
  26.     private $updatedAt;
  27.     /**
  28.      * @ORM\Column(type="text")
  29.      */
  30.     private $comment;
  31.     /**
  32.      * @ORM\ManyToOne(targetEntity=User::class)
  33.      * @ORM\JoinColumn(nullable=false)
  34.      * @Gedmo\Blameable(on="create")
  35.      */
  36.     private $author;
  37.     public function getLabel(): ?string
  38.     {
  39.         return $this->getFreelancer()->getLabel().' comment #'.$this->getId();
  40.     }
  41.     public function getId(): ?int
  42.     {
  43.         return $this->id;
  44.     }
  45.     public function getFreelancer(): ?Freelancer
  46.     {
  47.         return $this->freelancer;
  48.     }
  49.     public function setFreelancer(?Freelancer $freelancer): self
  50.     {
  51.         $this->freelancer $freelancer;
  52.         return $this;
  53.     }
  54.     public function getUpdatedAt(): ?\DateTimeInterface
  55.     {
  56.         return $this->updatedAt;
  57.     }
  58.     public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  59.     {
  60.         $this->updatedAt $updatedAt;
  61.         return $this;
  62.     }
  63.     public function getComment(): ?string
  64.     {
  65.         return $this->comment;
  66.     }
  67.     public function setComment(string $comment): self
  68.     {
  69.         $this->comment $comment;
  70.         return $this;
  71.     }
  72.     public function getAuthor(): ?User
  73.     {
  74.         return $this->author;
  75.     }
  76.     public function setAuthor(?User $author): self
  77.     {
  78.         $this->author $author;
  79.         return $this;
  80.     }
  81. }