<?php
namespace App\Entity;
use App\Repository\BlogPostGalleryItemConsultationRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=BlogPostGalleryItemConsultationRepository::class)
* @ORM\Table(
* name="blog_post_gallery_item_consultation",
* uniqueConstraints={
* @ORM\UniqueConstraint(name="uniq_bpgi_consultation_user_item", columns={"user_id", "gallery_item_id"})
* },
* indexes={
* @ORM\Index(name="idx_bpgi_consultation_consulted_at", columns={"consulted_at"})
* }
* )
*/
class BlogPostGalleryItemConsultation
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=User::class)
* @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
*/
private ?User $user = null;
/**
* @ORM\ManyToOne(targetEntity=BlogPostGalleryItem::class)
* @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
*/
private ?BlogPostGalleryItem $galleryItem = null;
/**
* @ORM\Column(type="datetime_immutable")
*/
private ?\DateTimeImmutable $consultedAt = null;
public function __construct()
{
$this->consultedAt = new \DateTimeImmutable();
}
public function getId(): ?int
{
return $this->id;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getGalleryItem(): ?BlogPostGalleryItem
{
return $this->galleryItem;
}
public function setGalleryItem(?BlogPostGalleryItem $galleryItem): self
{
$this->galleryItem = $galleryItem;
return $this;
}
public function getConsultedAt(): ?\DateTimeImmutable
{
return $this->consultedAt;
}
public function setConsultedAt(?\DateTimeImmutable $consultedAt): self
{
$this->consultedAt = $consultedAt;
return $this;
}
}