src/Entity/Events.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EventsRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClass: EventsRepository::class)]
  6. class Events
  7. {
  8. #[ORM\Id]
  9. #[ORM\GeneratedValue]
  10. #[ORM\Column(type: 'integer')]
  11. private $id;
  12. #[ORM\Column(type: 'string', length: 255)]
  13. private $title;
  14. #[ORM\Column(type: 'text', nullable: true)]
  15. private $note;
  16. #[ORM\Column(type: 'date')]
  17. private $due;
  18. #[ORM\Column(type: 'datetime')]
  19. private $created;
  20. #[ORM\Column(type: 'boolean', nullable: true, options: ['default' => true])]
  21. private $internal_mail;
  22. #[ORM\Column(type: 'datetime', nullable: true)]
  23. private $sended;
  24. #[ORM\Column(type: 'integer')]
  25. private $notiBeforeDays;
  26. #[ORM\ManyToOne(targetEntity: ProjectProducts::class, inversedBy: 'events')]
  27. #[ORM\JoinColumn(name: 'product_id', referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
  28. private $product;
  29. #[ORM\ManyToOne(targetEntity: Projects::class, inversedBy: 'events')]
  30. #[ORM\JoinColumn(name: 'project_id', referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
  31. private $project;
  32. #[ORM\Column(type: 'boolean')]
  33. private $isPublic;
  34. public function __construct(){
  35. $this->created = new \DateTime();
  36. $this->product = null;
  37. $this->notiBeforeDays = 1;
  38. }
  39. public function getId(): ?int
  40. {
  41. return $this->id;
  42. }
  43. public function getTitle(): ?string
  44. {
  45. return $this->title;
  46. }
  47. public function setTitle(string $title): self
  48. {
  49. $this->title = $title;
  50. return $this;
  51. }
  52. public function getNote(): ?string
  53. {
  54. return $this->note;
  55. }
  56. public function setNote(?string $note): self
  57. {
  58. $this->note = $note;
  59. return $this;
  60. }
  61. public function getDue(): ?\DateTimeInterface
  62. {
  63. return $this->due;
  64. }
  65. public function setDue(\DateTimeInterface $due): self
  66. {
  67. $this->due = $due;
  68. return $this;
  69. }
  70. public function getCreated(): ?\DateTimeInterface
  71. {
  72. return $this->created;
  73. }
  74. public function setCreated(\DateTimeInterface $created): self
  75. {
  76. $this->created = $created;
  77. return $this;
  78. }
  79. public function getInternalMail(): ?bool
  80. {
  81. return $this->internal_mail==null?true:$this->internal_mail;
  82. }
  83. public function setInternalMail(?bool $internal_mail): self
  84. {
  85. $this->internal_mail = $internal_mail;
  86. return $this;
  87. }
  88. public function getSended(): ?\DateTimeInterface
  89. {
  90. return $this->sended;
  91. }
  92. public function setSended(?\DateTimeInterface $sended): self
  93. {
  94. $this->sended = $sended;
  95. return $this;
  96. }
  97. public function getNotiBeforeDays(): ?int
  98. {
  99. return $this->notiBeforeDays;
  100. }
  101. public function setNotiBeforeDays(int $notiBeforeDays): self
  102. {
  103. $this->notiBeforeDays = $notiBeforeDays;
  104. return $this;
  105. }
  106. public function getProduct(): ?ProjectProducts
  107. {
  108. return $this->product;
  109. }
  110. public function setProduct(?ProjectProducts $product): self
  111. {
  112. $this->product = $product;
  113. return $this;
  114. }
  115. public function getProject(): ?Projects
  116. {
  117. return $this->project;
  118. }
  119. public function setProject(?Projects $project): self
  120. {
  121. $this->project = $project;
  122. return $this;
  123. }
  124. public function getIsPublic(): ?bool
  125. {
  126. return $this->isPublic;
  127. }
  128. public function setIsPublic(bool $isPublic): self
  129. {
  130. $this->isPublic = $isPublic;
  131. return $this;
  132. }
  133. }