<?php
namespace App\Entity;
use App\Repository\CommentProject2Repository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CommentProject2Repository::class)
*/
class CommentProject2
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $comment;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updateAt;
/**
* @ORM\ManyToOne(targetEntity="User", cascade={"persist"})
* @ORM\JoinColumn(name="user_id", referencedColumnName="id",nullable=true)
*/
private $user;
/**
* @ORM\ManyToOne(targetEntity="Project", cascade={"persist"}, inversedBy="commentProject2")
* @ORM\JoinColumn(name="project_id", referencedColumnName="id",nullable=true)
*/
private $project;
/**
* @ORM\OneToMany(targetEntity="CommentProject2Child", cascade={"persist"},mappedBy="commentProject2",orphanRemoval=true)
*/
private $commentProject2Child;
public function __construct()
{
$this->createdAt = new \DateTime();
$this->commentProject2Child = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getComment(): ?string
{
return $this->comment;
}
public function setComment(?string $comment): self
{
$this->comment = $comment;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getProject(): ?Project
{
return $this->project;
}
public function setProject(?Project $project): self
{
$this->project = $project;
return $this;
}
public function getUpdateAt(): ?\DateTimeInterface
{
return $this->updateAt;
}
public function setUpdateAt(?\DateTimeInterface $updateAt): self
{
$this->updateAt = $updateAt;
return $this;
}
/**
* @return Collection|CommentProject2Child[]
*/
public function getCommentProject2Child(): Collection
{
return $this->commentProject2Child;
}
public function addCommentProject2Child(CommentProject2Child $commentProject2Child): self
{
if (!$this->commentProject2Child->contains($commentProject2Child)) {
$this->commentProject2Child[] = $commentProject2Child;
$commentProject2Child->setCommentProject2($this);
}
return $this;
}
public function removeCommentProject2Child(CommentProject2Child $commentProject2Child): self
{
if ($this->commentProject2Child->removeElement($commentProject2Child)) {
// set the owning side to null (unless already changed)
if ($commentProject2Child->getCommentProject2() === $this) {
$commentProject2Child->setCommentProject2(null);
}
}
return $this;
}
}