<?phpnamespace App\Entity;use Doctrine\ORM\Mapping as ORM;use Ramsey\Uuid\UuidInterface;use Ramsey\Uuid\Doctrine\UuidGenerator;use Gedmo\Mapping\Annotation as Gedmo;/** * @ORM\Entity() */class GalleryView{ /** * @var UuidInterface * * @ORM\Id() * @ORM\Column(type="uuid", unique=true) * @ORM\GeneratedValue(strategy="CUSTOM") * @ORM\CustomIdGenerator(class=UuidGenerator::class) */ private $uid; /** * @var \DateTime * * @ORM\Column(type="datetime_immutable") * @Gedmo\Timestampable(on="create") */ private $timestamp; /** * @var string * * @ORM\Column(type="text") */ private $agent; /** * @var string * * @ORM\Column(type="string") */ private $ip; /** * @var Gallery * * @ORM\ManyToOne(targetEntity=Gallery::class, cascade={"persist"}, inversedBy="views") */ private $gallery; public function getUid(): UuidInterface { return $this->uid; } public function setUid(UuidInterface $uid): GalleryView { $this->uid = $uid; return $this; } public function getTimestamp(): \DateTimeImmutable { return $this->timestamp; } public function setTimestamp(\DateTimeImmutable $timestamp): GalleryView { $this->timestamp = $timestamp; return $this; } /** * @return string */ public function getAgent(): string { return $this->agent; } /** * @param string $agent * @return GalleryView */ public function setAgent(string $agent) { $this->agent = $agent; return $this; } /** * @return string */ public function getIp(): string { return $this->ip; } /** * @param string $ip * @return GalleryView */ public function setIp(string $ip) { $this->ip = $ip; return $this; } public function getGallery(): Gallery { return $this->gallery; } public function setGallery(Gallery $gallery): GalleryView { $this->gallery = $gallery; $this->gallery->addView($this); return $this; }}