src/Entity/GalleryView.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Ramsey\Uuid\UuidInterface;
  5. use Ramsey\Uuid\Doctrine\UuidGenerator;
  6. use Gedmo\Mapping\Annotation as Gedmo;
  7. /**
  8.  * @ORM\Entity()
  9.  */
  10. class GalleryView
  11. {
  12.     /**
  13.      * @var UuidInterface
  14.      *
  15.      * @ORM\Id()
  16.      * @ORM\Column(type="uuid", unique=true)
  17.      * @ORM\GeneratedValue(strategy="CUSTOM")
  18.      * @ORM\CustomIdGenerator(class=UuidGenerator::class)
  19.      */
  20.     private $uid;
  21.     /**
  22.      * @var \DateTime
  23.      *
  24.      * @ORM\Column(type="datetime_immutable")
  25.      * @Gedmo\Timestampable(on="create")
  26.      */
  27.     private $timestamp;
  28.     /**
  29.      * @var string
  30.      *
  31.      * @ORM\Column(type="text")
  32.      */
  33.     private $agent;
  34.     /**
  35.      * @var string
  36.      *
  37.      * @ORM\Column(type="string")
  38.      */
  39.     private $ip;
  40.     /**
  41.      * @var Gallery
  42.      *
  43.      * @ORM\ManyToOne(targetEntity=Gallery::class, cascade={"persist"}, inversedBy="views")
  44.      */
  45.     private $gallery;
  46.     public function getUid(): UuidInterface
  47.     {
  48.         return $this->uid;
  49.     }
  50.     public function setUid(UuidInterface $uid): GalleryView
  51.     {
  52.         $this->uid $uid;
  53.         return $this;
  54.     }
  55.     public function getTimestamp(): \DateTimeImmutable
  56.     {
  57.         return $this->timestamp;
  58.     }
  59.     public function setTimestamp(\DateTimeImmutable $timestamp): GalleryView
  60.     {
  61.         $this->timestamp $timestamp;
  62.         return $this;
  63.     }
  64.     /**
  65.      * @return string
  66.      */
  67.     public function getAgent(): string
  68.     {
  69.         return $this->agent;
  70.     }
  71.     /**
  72.      * @param string $agent
  73.      * @return GalleryView
  74.      */
  75.     public function setAgent(string $agent)
  76.     {
  77.         $this->agent $agent;
  78.         return $this;
  79.     }
  80.     /**
  81.      * @return string
  82.      */
  83.     public function getIp(): string
  84.     {
  85.         return $this->ip;
  86.     }
  87.     /**
  88.      * @param string $ip
  89.      * @return GalleryView
  90.      */
  91.     public function setIp(string $ip)
  92.     {
  93.         $this->ip $ip;
  94.         return $this;
  95.     }
  96.     public function getGallery(): Gallery
  97.     {
  98.         return $this->gallery;
  99.     }
  100.     public function setGallery(Gallery $gallery): GalleryView
  101.     {
  102.         $this->gallery $gallery;
  103.         $this->gallery->addView($this);
  104.         return $this;
  105.     }
  106. }