src/Entity/Post.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Gedmo\Timestampable\Traits\TimestampableEntity;
  5. use Symfony\Component\HttpFoundation\File\UploadedFile;
  6. use Symfony\Component\Serializer\Annotation\Context;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
  9. /**
  10.  * @ORM\Entity(repositoryClass="App\Repository\PostRepository")
  11.  */
  12. class Post
  13. {
  14.     use TimestampableEntity;
  15.     /**
  16.      * @ORM\Id()
  17.      * @ORM\GeneratedValue()
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string", length=255)
  23.      * @Assert\NotBlank()
  24.      */
  25.     private $title;
  26.     /**
  27.      * @ORM\Column(type="datetime")
  28.      * @Assert\NotBlank()
  29.      * @Context({DateTimeNormalizer::FORMAT_KEY="Y/m/d"})
  30.      */
  31.     private $publishedAt;
  32.     /**
  33.      * @ORM\Column(type="text")
  34.      * @Assert\NotBlank()
  35.      */
  36.     private $content;
  37.     /**
  38.      * @ORM\Column(type="datetime", nullable=true)
  39.      */
  40.     private $emailSentAt;
  41.     /**
  42.      * @ORM\Column(type="boolean")
  43.      */
  44.     private $toUser 1;
  45.     /**
  46.      * @ORM\Column(type="boolean", options={"default":1})
  47.      */
  48.     private $toShop 1;
  49.     /**
  50.      * @ORM\Column(type="string", length=255, nullable=true)
  51.      */
  52.     private $image;
  53.     /**
  54.      * @var string
  55.      */
  56.     private $defaultImage;
  57.     /**
  58.      * @var UploadedFile
  59.      */
  60.     private $ieImage;
  61.     public function getId(): ?int
  62.     {
  63.         return $this->id;
  64.     }
  65.     public function getTitle(): ?string
  66.     {
  67.         return $this->title;
  68.     }
  69.     public function setTitle(string $title): self
  70.     {
  71.         $this->title $title;
  72.         return $this;
  73.     }
  74.     public function getPublishedAt(): ?\DateTimeInterface
  75.     {
  76.         return $this->publishedAt;
  77.     }
  78.     public function setPublishedAt(\DateTimeInterface $publishedAt): self
  79.     {
  80.         $this->publishedAt $publishedAt;
  81.         return $this;
  82.     }
  83.     public function getContent(): ?string
  84.     {
  85.         return $this->content;
  86.     }
  87.     public function setContent(string $content): self
  88.     {
  89.         $this->content $content;
  90.         return $this;
  91.     }
  92.     /**
  93.      * @return \DateTimeInterface
  94.      */
  95.     public function getEmailSentAt()
  96.     {
  97.         return $this->emailSentAt;
  98.     }
  99.     /**
  100.      * @param \DateTimeInterface $emailSentAt
  101.      *
  102.      * @return $this
  103.      */
  104.     public function setEmailSentAt($emailSentAt)
  105.     {
  106.         $this->emailSentAt $emailSentAt;
  107.         return $this;
  108.     }
  109.     public function getToUser(): ?bool
  110.     {
  111.         return $this->toUser;
  112.     }
  113.     public function setToUser(bool $toUser): self
  114.     {
  115.         $this->toUser $toUser;
  116.         return $this;
  117.     }
  118.     public function getToShop(): ?bool
  119.     {
  120.         return $this->toShop;
  121.     }
  122.     public function setToShop(bool $toShop): self
  123.     {
  124.         $this->toShop $toShop;
  125.         return $this;
  126.     }
  127.     public function getImage(): ?string
  128.     {
  129.         return $this->image;
  130.     }
  131.     public function setImage(?string $image): self
  132.     {
  133.         $this->image $image;
  134.         return $this;
  135.     }
  136.     /**
  137.      * @return UploadedFile
  138.      */
  139.     public function getIeImage(): ?UploadedFile
  140.     {
  141.         return $this->ieImage;
  142.     }
  143.     /**
  144.      * @param UploadedFile $ieImage
  145.      *
  146.      * @return $this
  147.      */
  148.     public function setIeImage($ieImage)
  149.     {
  150.         $this->ieImage $ieImage;
  151.         return $this;
  152.     }
  153.     public function getDefaultImage(): ?string
  154.     {
  155.         return $this->defaultImage;
  156.     }
  157.     public function setDefaultImage(?string $image): self
  158.     {
  159.         $this->defaultImage $image;
  160.         return $this;
  161.     }
  162. }