src/Entity/PublicAction.php line 20

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Gedmo\Mapping\Annotation as Gedmo;
  9. /**
  10. * PublicAction.
  11. *
  12. * @ORM\Table(name="PublicAction")
  13. *
  14. * @ORM\Entity()
  15. */
  16. class PublicAction
  17. {
  18. /**
  19. * @var int
  20. *
  21. * @ORM\Column(name="id", type="integer")
  22. *
  23. * @ORM\Id
  24. *
  25. * @ORM\GeneratedValue(strategy="AUTO")
  26. */
  27. private $id;
  28. /**
  29. * @var string
  30. *
  31. * @ORM\Column(name="name", type="string", length=255, nullable=true)
  32. */
  33. private $name;
  34. /**
  35. * @Gedmo\Timestampable(on="create")
  36. *
  37. * @ORM\Column(name="created", type="datetime")
  38. */
  39. private $created;
  40. /**
  41. * @ORM\Column(name="updated", type="datetime")
  42. *
  43. * @Gedmo\Timestampable(on="update")
  44. */
  45. private $updated;
  46. /**
  47. * @ORM\OneToMany(targetEntity="FicheAction", mappedBy="public")
  48. */
  49. private $fichesAction;
  50. /**
  51. * Constructor.
  52. */
  53. public function __construct()
  54. {
  55. $this->fichesAction = new \Doctrine\Common\Collections\ArrayCollection();
  56. }
  57. #[\Override]
  58. public function __toString(): string
  59. {
  60. return $this->name;
  61. }
  62. /**
  63. * Get id.
  64. *
  65. * @return int
  66. */
  67. public function getId()
  68. {
  69. return $this->id;
  70. }
  71. /**
  72. * Set name.
  73. *
  74. * @param string $name
  75. */
  76. public function setName($name): static
  77. {
  78. $this->name = $name;
  79. return $this;
  80. }
  81. /**
  82. * Get name.
  83. *
  84. * @return string
  85. */
  86. public function getName()
  87. {
  88. return $this->name;
  89. }
  90. /**
  91. * Set created.
  92. *
  93. * @param \DateTime $created
  94. */
  95. public function setCreated($created): static
  96. {
  97. $this->created = $created;
  98. return $this;
  99. }
  100. /**
  101. * Get created.
  102. *
  103. * @return \DateTime
  104. */
  105. public function getCreated()
  106. {
  107. return $this->created;
  108. }
  109. /**
  110. * Set updated.
  111. *
  112. * @param \DateTime $updated
  113. */
  114. public function setUpdated($updated): static
  115. {
  116. $this->updated = $updated;
  117. return $this;
  118. }
  119. /**
  120. * Get updated.
  121. *
  122. * @return \DateTime
  123. */
  124. public function getUpdated()
  125. {
  126. return $this->updated;
  127. }
  128. /**
  129. * Add fichesAction.
  130. */
  131. public function addFichesAction(FicheAction $fichesAction): static
  132. {
  133. $this->fichesAction[] = $fichesAction;
  134. return $this;
  135. }
  136. /**
  137. * Remove fichesAction.
  138. */
  139. public function removeFichesAction(FicheAction $fichesAction): void
  140. {
  141. $this->fichesAction->removeElement($fichesAction);
  142. }
  143. /**
  144. * Get fichesAction.
  145. *
  146. * @return \Doctrine\Common\Collections\Collection
  147. */
  148. public function getFichesAction()
  149. {
  150. return $this->fichesAction;
  151. }
  152. }