123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <?php
- namespace App\Entity;
- use App\Repository\CommentaireRepository;
- use Doctrine\ORM\Mapping as ORM;
- #[ORM\Table(name: "commentaire")]
- #[ORM\Entity(repositoryClass: CommentaireRepository::class)]
- class Commentaire
- {
- #[ORM\Column(name: "id", type: "integer")]
- #[ORM\Id]
- #[ORM\GeneratedValue(strategy: "AUTO")]
- private $id;
- #[ORM\Column(name: "contenu", type: "text", length: 191, nullable: true)]
- private $contenu;
- #[ORM\Column(name: "note", type: "integer", nullable: true)]
- private $note;
- #[ORM\ManyToOne(targetEntity: Film::class, inversedBy: "commentaires")]
- #[ORM\JoinColumn(nullable: false)]
- private $film;
- #[ORM\ManyToOne(targetEntity: User::class)]
- #[ORM\JoinColumn(nullable: false)]
- private $user;
- #[ORM\Column(type: "datetime", nullable: true)]
- private $dateSubmitted;
- public function __construct ()
- {
- $this->dateSubmitted = new \DateTime('now');
- }
- public function getId(): ?int
- {
- return $this->id;
- }
- public function setContenu($contenu): self
- {
- $this->contenu = $contenu;
- return $this;
- }
- public function getContenu(): ?string
- {
- return $this->contenu;
- }
- public function getNote(): ?int
- {
- return $this->note;
- }
- public function setNote($note): self
- {
- $this->note = $note;
- return $this;
- }
- public function setFilm(\App\Entity\Film $film): self
- {
- $this->film = $film;
- return $this;
- }
- public function getFilm(): Film
- {
- return $this->film;
- }
- public function setUser(\App\Entity\User $user): self
- {
- $this->user = $user;
- return $this;
- }
- public function getUser(): User
- {
- return $this->user;
- }
- public function getDateSubmitted(): ?\DateTimeInterface
- {
- return $this->dateSubmitted;
- }
- public function setDateSubmitted(?\DateTimeInterface $dateSubmitted): self
- {
- $this->dateSubmitted = $dateSubmitted;
- return $this;
- }
- }
|