for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity(repositoryClass="App\Repository\CommentRepository")
*/
class Comment extends AppEntity
{
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
private $id;
* @ORM\Column(type="text")
private $comment;
* @ORM\Column(type="datetime")
* @Gedmo\Timestampable(on="create")
private $createdAt;
* @ORM\ManyToOne(targetEntity="App\Entity\Trick", inversedBy="comments")
private $trick;
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="Comments")
private $user;
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;
public function getTrick(): ?Trick
return $this->trick;
public function setTrick(?Trick $trick): self
$this->trick = $trick;
public function getUser(): ?User
return $this->user;
public function setUser(?User $user): self
$this->user = $user;
public function __toString()
return 'In trick '.$this->getTrick()->getName();