src/Entity/BlogPostGalleryItemConsultation.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\BlogPostGalleryItemConsultationRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=BlogPostGalleryItemConsultationRepository::class)
  7.  * @ORM\Table(
  8.  *     name="blog_post_gallery_item_consultation",
  9.  *     uniqueConstraints={
  10.  *         @ORM\UniqueConstraint(name="uniq_bpgi_consultation_user_item", columns={"user_id", "gallery_item_id"})
  11.  *     },
  12.  *     indexes={
  13.  *         @ORM\Index(name="idx_bpgi_consultation_consulted_at", columns={"consulted_at"})
  14.  *     }
  15.  * )
  16.  */
  17. class BlogPostGalleryItemConsultation
  18. {
  19.     /**
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue
  22.      * @ORM\Column(type="integer")
  23.      */
  24.     private $id;
  25.     /**
  26.      * @ORM\ManyToOne(targetEntity=User::class)
  27.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  28.      */
  29.     private ?User $user null;
  30.     /**
  31.      * @ORM\ManyToOne(targetEntity=BlogPostGalleryItem::class)
  32.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  33.      */
  34.     private ?BlogPostGalleryItem $galleryItem null;
  35.     /**
  36.      * @ORM\Column(type="datetime_immutable")
  37.      */
  38.     private ?\DateTimeImmutable $consultedAt null;
  39.     public function __construct()
  40.     {
  41.         $this->consultedAt = new \DateTimeImmutable();
  42.     }
  43.     public function getId(): ?int
  44.     {
  45.         return $this->id;
  46.     }
  47.     public function getUser(): ?User
  48.     {
  49.         return $this->user;
  50.     }
  51.     public function setUser(?User $user): self
  52.     {
  53.         $this->user $user;
  54.         return $this;
  55.     }
  56.     public function getGalleryItem(): ?BlogPostGalleryItem
  57.     {
  58.         return $this->galleryItem;
  59.     }
  60.     public function setGalleryItem(?BlogPostGalleryItem $galleryItem): self
  61.     {
  62.         $this->galleryItem $galleryItem;
  63.         return $this;
  64.     }
  65.     public function getConsultedAt(): ?\DateTimeImmutable
  66.     {
  67.         return $this->consultedAt;
  68.     }
  69.     public function setConsultedAt(?\DateTimeImmutable $consultedAt): self
  70.     {
  71.         $this->consultedAt $consultedAt;
  72.         return $this;
  73.     }
  74. }