src/Entity/Document.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DocumentRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. #[ORM\Entity(repositoryClassDocumentRepository::class)]
  7. #[Gedmo\SoftDeleteable(fieldName'deletedAt'timeAwarefalse)]
  8. class Document extends RootEntity
  9. {
  10.   #[ORM\Id]
  11.   #[ORM\GeneratedValue]
  12.   #[ORM\Column]
  13.   private ?int $id null;
  14.   #[ORM\Column(type'string'nullabletrue)]
  15.   private $title;
  16.   #[ORM\Column(type'integer')]
  17.   private $type 0;
  18.   #[ORM\ManyToOne]
  19.   private ?Attachment $attachment null;
  20.   #[ORM\ManyToOne(inversedBy'documents')]
  21.   private ?User $user null;
  22.   public function getId(): ?int
  23.   {
  24.     return $this->id;
  25.   }
  26.   public function getAttachment(): ?Attachment
  27.   {
  28.     return $this->attachment;
  29.   }
  30.   public function setAttachment(?Attachment $attachment): self
  31.   {
  32.     $this->attachment $attachment;
  33.     return $this;
  34.   }
  35.   public function getUser(): ?User
  36.   {
  37.     return $this->user;
  38.   }
  39.   public function setUser(?User $user): self
  40.   {
  41.     $this->user $user;
  42.     return $this;
  43.   }
  44.   public function getTitle(): ?string
  45.   {
  46.     return $this->title;
  47.   }
  48.   public function setTitle(?string $title): self
  49.   {
  50.     $this->title $title;
  51.     return $this;
  52.   }
  53.   public function getType(): ?int
  54.   {
  55.     return $this->type;
  56.   }
  57.   public function setType(int $type): self
  58.   {
  59.     $this->type $type;
  60.     return $this;
  61.   }
  62. }