src/Entity/Post.php line 13

  1. <?php
  2. namespace App\Entity;
  3. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use App\Repository\PostRepository;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. #[ORM\Entity(repositoryClassPostRepository::class)]
  9. #[Gedmo\SoftDeleteable(fieldName'deletedAt'timeAwarefalse)]
  10. class Post extends RootEntity
  11. {
  12.   #[ORM\Id]
  13.   #[ORM\GeneratedValue]
  14.   #[ORM\Column(type'integer')]
  15.   private $id;
  16.   #[ORM\Column(type'string'length255nullabletrue)]
  17.   private $title;
  18.   #[ORM\Column(type'integer')]
  19.   private $status 0;
  20.   #[ORM\Column(type'integer')]
  21.   private $type 0;
  22.   #[ORM\Column(type'text'nullabletrue)]
  23.   private $body;
  24.   #[ORM\ManyToOne(targetEntityAttachment::class, cascade: ["Persist"])]
  25.   #[ORM\JoinColumn(onDelete:'SET NULL')]
  26.   private $thumbnail;
  27.   #[ORM\Column(type'integer')]
  28.   private $authorId 0;
  29.   public function getId(): ?int
  30.   {
  31.     return $this->id;
  32.   }
  33.   public function getTitle(): ?string
  34.   {
  35.     return $this->title;
  36.   }
  37.   public function setTitle(?string $title): self
  38.   {
  39.     $this->title $title;
  40.     return $this;
  41.   }
  42.   public function getStatus(): ?int
  43.   {
  44.     return $this->status;
  45.   }
  46.   public function setStatus(int $status): self
  47.   {
  48.     $this->status $status;
  49.     return $this;
  50.   }
  51.   public function getType(): ?int
  52.   {
  53.     return $this->type;
  54.   }
  55.   public function setType(int $type): self
  56.   {
  57.     $this->type $type;
  58.     return $this;
  59.   }
  60.   public function getBody(): ?string
  61.   {
  62.     return $this->body;
  63.   }
  64.   public function setBody(?string $body): self
  65.   {
  66.     $this->body $body;
  67.     return $this;
  68.   }
  69.   public function getAuthorId(): ?int
  70.   {
  71.     return $this->authorId;
  72.   }
  73.   public function setAuthorId(int $authorId): self
  74.   {
  75.     $this->authorId $authorId;
  76.     return $this;
  77.   }
  78.   public function getOther(): array
  79.   {
  80.     return $this->other;
  81.   }
  82.   public function setOther(?array $other): self
  83.   {
  84.     $this->other $other;
  85.     return $this;
  86.   }
  87.   public function getThumbnail(): ?Attachment
  88.   {
  89.     return $this->thumbnail;
  90.   }
  91.   public function setThumbnail(?Attachment $thumbnail): self
  92.   {
  93.     $this->thumbnail $thumbnail;
  94.     return $this;
  95.   }
  96. }