<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\Serializer\Annotation\Context;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
/**
* @ORM\Entity(repositoryClass="App\Repository\PostRepository")
*/
class Post
{
use TimestampableEntity;
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
* @Assert\NotBlank()
*/
private $title;
/**
* @ORM\Column(type="datetime")
* @Assert\NotBlank()
* @Context({DateTimeNormalizer::FORMAT_KEY="Y/m/d"})
*/
private $publishedAt;
/**
* @ORM\Column(type="text")
* @Assert\NotBlank()
*/
private $content;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $emailSentAt;
/**
* @ORM\Column(type="boolean")
*/
private $toUser = 1;
/**
* @ORM\Column(type="boolean", options={"default":1})
*/
private $toShop = 1;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $image;
/**
* @var string
*/
private $defaultImage;
/**
* @var UploadedFile
*/
private $ieImage;
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getPublishedAt(): ?\DateTimeInterface
{
return $this->publishedAt;
}
public function setPublishedAt(\DateTimeInterface $publishedAt): self
{
$this->publishedAt = $publishedAt;
return $this;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(string $content): self
{
$this->content = $content;
return $this;
}
/**
* @return \DateTimeInterface
*/
public function getEmailSentAt()
{
return $this->emailSentAt;
}
/**
* @param \DateTimeInterface $emailSentAt
*
* @return $this
*/
public function setEmailSentAt($emailSentAt)
{
$this->emailSentAt = $emailSentAt;
return $this;
}
public function getToUser(): ?bool
{
return $this->toUser;
}
public function setToUser(bool $toUser): self
{
$this->toUser = $toUser;
return $this;
}
public function getToShop(): ?bool
{
return $this->toShop;
}
public function setToShop(bool $toShop): self
{
$this->toShop = $toShop;
return $this;
}
public function getImage(): ?string
{
return $this->image;
}
public function setImage(?string $image): self
{
$this->image = $image;
return $this;
}
/**
* @return UploadedFile
*/
public function getIeImage(): ?UploadedFile
{
return $this->ieImage;
}
/**
* @param UploadedFile $ieImage
*
* @return $this
*/
public function setIeImage($ieImage)
{
$this->ieImage = $ieImage;
return $this;
}
public function getDefaultImage(): ?string
{
return $this->defaultImage;
}
public function setDefaultImage(?string $image): self
{
$this->defaultImage = $image;
return $this;
}
}