src/Entity/BonusImage.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use JMS\Serializer\Annotation\Groups;
  5. /**
  6.  * @ORM\Table("BonusImage")
  7.  *
  8.  * @ORM\HasLifecycleCallbacks()
  9.  *
  10.  * @ORM\Entity(repositoryClass="App\Repository\BonusImageRepository")
  11.  */
  12. class BonusImage
  13. {
  14.     /**
  15.      * @Groups({"adminindex", "frontendindex"})
  16.      *
  17.      * @ORM\Id()
  18.      *
  19.      * @ORM\GeneratedValue()
  20.      *
  21.      * @ORM\Column(type="integer")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @Groups({"adminindex"})
  26.      *
  27.      * @ORM\Column(type="string", length=100)
  28.      */
  29.     private $name;
  30.     /**
  31.      * @Groups({"adminindex"})
  32.      *
  33.      * @ORM\Column(type="string", length=100, unique=true)
  34.      */
  35.     private $filename;
  36.     /**
  37.      * @Groups({"adminindex"})
  38.      *
  39.      * @ORM\Column(type="datetime")
  40.      */
  41.     private $created_at;
  42.     /**
  43.      * @Groups({"adminindex", "frontendindex"})
  44.      *
  45.      * @ORM\Column(type="datetime")
  46.      */
  47.     private $begin_at;
  48.     /**
  49.      * @Groups({"adminindex", "frontendindex"})
  50.      *
  51.      * @ORM\Column(type="datetime")
  52.      */
  53.     private $end_at;
  54.     /**
  55.      * @Groups({"adminindex", "frontendindex"})
  56.      *
  57.      * @var string
  58.      */
  59.     private $url;
  60.     /**
  61.      * @ORM\PrePersist()
  62.      */
  63.     public function prePersist()
  64.     {
  65.         $this->setCreatedAt(new \DateTime());
  66.     }
  67.     public function getId()
  68.     {
  69.         return $this->id;
  70.     }
  71.     public function getName(): ?string
  72.     {
  73.         return $this->name;
  74.     }
  75.     public function setName(string $name): self
  76.     {
  77.         $this->name $name;
  78.         return $this;
  79.     }
  80.     public function setUrl(string $url): self
  81.     {
  82.         $this->url $url;
  83.         return $this;
  84.     }
  85.     public function getFilename(): ?string
  86.     {
  87.         return $this->filename;
  88.     }
  89.     public function setFilename(string $filename): self
  90.     {
  91.         $this->filename $filename;
  92.         return $this;
  93.     }
  94.     public function getCreatedAt(): ?\DateTimeInterface
  95.     {
  96.         return $this->created_at;
  97.     }
  98.     public function setCreatedAt(\DateTimeInterface $created_at): self
  99.     {
  100.         $this->created_at $created_at;
  101.         return $this;
  102.     }
  103.     public function getBeginAt(): ?\DateTimeInterface
  104.     {
  105.         return $this->begin_at;
  106.     }
  107.     /**
  108.      * @param string|\DateTimeInterface $begin_at
  109.      */
  110.     public function setBeginAt($begin_at): self
  111.     {
  112.         if (is_string($begin_at)) {
  113.             $begin_at = new \DateTime($begin_at);
  114.         }
  115.         $this->begin_at $begin_at;
  116.         return $this;
  117.     }
  118.     public function getEndAt(): ?\DateTimeInterface
  119.     {
  120.         return $this->end_at;
  121.     }
  122.     /**
  123.      * @param string|\DateTimeInterface $end_at
  124.      */
  125.     public function setEndAt($end_at): self
  126.     {
  127.         if (is_string($end_at)) {
  128.             $end_at = new \DateTime($end_at);
  129.         }
  130.         $this->end_at $end_at;
  131.         return $this;
  132.     }
  133. }