src/Entity/Comment.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Entity(repositoryClass="App\Repository\CommentRepository")
  6.  */
  7. class Comment
  8. {
  9.     /**
  10.      * @ORM\Id()
  11.      * @ORM\GeneratedValue()
  12.      * @ORM\Column(type="integer")
  13.      */
  14.     private $id;
  15.     
  16.     /**
  17.      * @ORM\Version @ORM\Column(type="integer")
  18.      */
  19.     private $version;
  20.     /**
  21.      * @ORM\ManyToOne(targetEntity="App\Entity\Content", inversedBy="comments")
  22.      * @ORM\JoinColumn(nullable=true)
  23.      */
  24.     private $content;
  25.     /**
  26.      * @ORM\Column(type="string", length=255)
  27.      */
  28.     private $author;
  29.     /**
  30.      * @ORM\Column(type="string", length=255)
  31.      */
  32.     private $author_email;
  33.     /**
  34.      * @ORM\Column(type="string", length=255)
  35.      */
  36.     private $author_url;
  37.     /**
  38.      * @ORM\Column(type="string", length=255)
  39.      */
  40.     private $author_IP;
  41.     /**
  42.      * @ORM\Column(type="datetime")
  43.      */
  44.     private $created_at;
  45.     /**
  46.      * @ORM\Column(type="datetime")
  47.      */
  48.     private $modified_at;
  49.     /**
  50.      * @ORM\Column(type="integer")
  51.      */
  52.     private $karma;
  53.     /**
  54.      * @ORM\Column(type="string", length=255)
  55.      */
  56.     private $approved;
  57.     /**
  58.      * @ORM\Column(type="string", length=255)
  59.      */
  60.     private $agent;
  61.     /**
  62.      * @ORM\Column(type="string", length=255)
  63.      */
  64.     private $type;
  65.     /**
  66.      * @ORM\OneToOne(targetEntity="App\Entity\Comment", cascade={"persist", "remove"})
  67.      */
  68.     private $prnt;
  69.     /**
  70.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="comments")
  71.      */
  72.     private $user;
  73.     /**
  74.      * @ORM\Column(type="string", length=255)
  75.      */
  76.     private $comment_text;
  77.     public function __construct()
  78.     {
  79.         $this->author "";
  80.         $this->author_url "";
  81.         $this->author_IP "";
  82.         $this->author_email "";
  83.         $this->karma 0;
  84.         $this->approved 0;
  85.         $this->agent "";
  86.         $this->type "";
  87.         $this->comment_text "";
  88.         
  89.         $this->created_at = new \DateTime ();
  90.         $this->modified_at = new \DateTime();
  91.     }
  92.     
  93.     public function getId()
  94.     {
  95.         return $this->id;
  96.     }
  97.     
  98.     public function getVersion() {
  99.         return $this->version;
  100.     }
  101.     
  102.     public function getContent(): ?Content
  103.     {
  104.         return $this->content;
  105.     }
  106.     public function setContent(?Content $content): self
  107.     {
  108.         $this->content $content;
  109.         return $this;
  110.     }
  111.     public function getAuthor(): ?string
  112.     {
  113.         return $this->author;
  114.     }
  115.     public function setAuthor(string $author null): self
  116.     {
  117.         $this->author $author $author "";
  118.         return $this;
  119.     }
  120.     public function getAuthorEmail(): ?string
  121.     {
  122.         return $this->author_email;
  123.     }
  124.     public function setAuthorEmail(string $author_email null): self
  125.     {
  126.         $this->author_email $author_email $author_email "";
  127.         return $this;
  128.     }
  129.     public function getAuthorUrl(): ?string
  130.     {
  131.         return $this->author_url;
  132.     }
  133.     public function setAuthorUrl(string $author_url null): self
  134.     {
  135.         $this->author_url $author_url $author_url "";
  136.         return $this;
  137.     }
  138.     public function getAuthorIP(): ?string
  139.     {
  140.         return $this->author_IP;
  141.     }
  142.     public function setAuthorIP(string $author_IP null): self
  143.     {
  144.         $this->author_IP $author_IP $author_IP "";
  145.         return $this;
  146.     }
  147.     public function getCreatedAt(): ?\DateTimeInterface
  148.     {
  149.         return $this->created_at;
  150.     }
  151.     public function setCreatedAt(\DateTimeInterface $created_at): self
  152.     {
  153.         $this->created_at $created_at;
  154.         return $this;
  155.     }
  156.     public function getModifiedAt(): ?\DateTimeInterface
  157.     {
  158.         return $this->modified_at;
  159.     }
  160.     public function setModifiedAt(\DateTimeInterface $modified_at): self
  161.     {
  162.         $this->modified_at $modified_at;
  163.         return $this;
  164.     }
  165.     public function getKarma(): ?int
  166.     {
  167.         return $this->karma;
  168.     }
  169.     public function setKarma(int $karma): self
  170.     {
  171.         $this->karma $karma;
  172.         return $this;
  173.     }
  174.     public function getApproved(): ?string
  175.     {
  176.         return $this->approved;
  177.     }
  178.     public function setApproved(string $approved null): self
  179.     {
  180.         $this->approved $approved $approved "";
  181.         return $this;
  182.     }
  183.     public function getAgent(): ?string
  184.     {
  185.         return $this->agent;
  186.     }
  187.     public function setAgent(string $agent null): self
  188.     {
  189.         $this->agent $agent $agent "";
  190.         return $this;
  191.     }
  192.     public function getType(): ?string
  193.     {
  194.         return $this->type;
  195.     }
  196.     public function setType(string $type null): self
  197.     {
  198.         $this->type $type $type "";
  199.         return $this;
  200.     }
  201.     public function getPrnt(): ?self
  202.     {
  203.         return $this->prnt;
  204.     }
  205.     public function setPrnt(?self $prnt): self
  206.     {
  207.         $this->prnt $prnt;
  208.         return $this;
  209.     }
  210.     public function getUser(): ?User
  211.     {
  212.         return $this->user;
  213.     }
  214.     public function setUser(?User $user): self
  215.     {
  216.         $this->user $user;
  217.         return $this;
  218.     }
  219.     public function getCommentText(): ?string
  220.     {
  221.         return $this->comment_text;
  222.     }
  223.     public function setCommentText(string $comment_text null): self
  224.     {
  225.         $this->comment_text $comment_text $comment_text "";
  226.         return $this;
  227.     }
  228.     
  229.     public function __toString()
  230.     {
  231.         return $this->comment_text $this->comment_text "";
  232.     }
  233. }