src/Entity/PdfFiles.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. #[ORM\Table(name: 'pdf_files')]
  5. #[ORM\Entity]
  6. class PdfFiles
  7. {
  8. #[ORM\Column(name: 'id', type: 'integer', nullable: false)]
  9. #[ORM\Id]
  10. #[ORM\GeneratedValue(strategy: 'IDENTITY')]
  11. private $id;
  12. #[ORM\Column(name: 'filepath', type: 'string', length: 250, nullable: false)]
  13. private $filepath;
  14. #[ORM\Column(name: 'type', type: 'string', length: 250, nullable: true)]
  15. private $type;
  16. #[ORM\Column(name: 'created', type: 'datetime', nullable: false)]
  17. private $created;
  18. #[ORM\ManyToOne(targetEntity: Contracts::class, inversedBy: 'files')]
  19. private $contracts;
  20. public function __construct()
  21. {
  22. $this->created = new \DateTime();
  23. }
  24. public function getId(): ?int
  25. {
  26. return $this->id;
  27. }
  28. public function getFilepath(): ?string
  29. {
  30. return $this->filepath;
  31. }
  32. public function setFilepath(string $filepath): self
  33. {
  34. $this->filepath = $filepath;
  35. return $this;
  36. }
  37. public function getType(): ?string
  38. {
  39. return $this->type;
  40. }
  41. public function setType(?string $type): self
  42. {
  43. $this->type = $type;
  44. return $this;
  45. }
  46. public function getCreated(): ?\DateTimeInterface
  47. {
  48. return $this->created;
  49. }
  50. public function setCreated(\DateTimeInterface $created): self
  51. {
  52. $this->created = $created;
  53. return $this;
  54. }
  55. public function __toString(){
  56. return $this->filepath;
  57. }
  58. public function getContracts(): ?Contracts
  59. {
  60. return $this->contracts;
  61. }
  62. public function setContracts(?Contracts $contracts): self
  63. {
  64. $this->contracts = $contracts;
  65. return $this;
  66. }
  67. }