src/Entity/Tracker.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TrackerRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Doctrine\DBAL\Types\Types;
  6. #[ORM\Entity(repositoryClass: TrackerRepository::class)]
  7. class Tracker
  8. {
  9. #[ORM\Id]
  10. #[ORM\GeneratedValue]
  11. #[ORM\Column(type: Types::INTEGER, options:["unsigned" => true])]
  12. private ?int $id = null;
  13. #[ORM\ManyToOne(inversedBy: 'trackers')]
  14. #[ORM\JoinColumn(name: "i_seed_fk", nullable: false, onDelete: "CASCADE")]
  15. private Seed $seed;
  16. #[ORM\Column]
  17. private \DateTimeImmutable $dtCreation;
  18. #[ORM\Column(length: 255)]
  19. private string $sTemplate;
  20. #[ORM\Column(length: 255, nullable: true)]
  21. private ?string $sAction = null;
  22. #[ORM\Column(length: 255, nullable: true)]
  23. private string $sObs;
  24. public function __construct(Seed $seed, string $sTemplate, string $sObs)
  25. {
  26. $this->seed = $seed;
  27. $this->sTemplate = $sTemplate;
  28. $this->dtCreation = new \DateTimeImmutable();
  29. $this->sObs = substr($sObs, 0, 250);
  30. }
  31. public function getId(): ?int
  32. {
  33. return $this->id;
  34. }
  35. public function getSeed(): Seed
  36. {
  37. return $this->seed;
  38. }
  39. public function setSeed(Seed $seed): static
  40. {
  41. $this->seed = $seed;
  42. return $this;
  43. }
  44. public function getDtCreation(): \DateTimeImmutable
  45. {
  46. return $this->dtCreation;
  47. }
  48. public function setDtCreation(\DateTimeImmutable $dtCreation): static
  49. {
  50. $this->dtCreation = $dtCreation;
  51. return $this;
  52. }
  53. public function getSTemplate(): string
  54. {
  55. return $this->sTemplate;
  56. }
  57. public function setSTemplate(string $sTemplate): static
  58. {
  59. $this->sTemplate = $sTemplate;
  60. return $this;
  61. }
  62. public function getSAction(): ?string
  63. {
  64. return $this->sAction;
  65. }
  66. public function setSAction(string $sAction): static
  67. {
  68. $this->sAction = $sAction;
  69. return $this;
  70. }
  71. public function getSObs(): string
  72. {
  73. return $this->sObs;
  74. }
  75. public function setSObs(string $sObs): static
  76. {
  77. $this->sObs = $sObs;
  78. return $this;
  79. }
  80. }