src/Entity/Seed.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SeedRepository;
  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 App\Enum\Product;
  9. use App\Enum\Home;
  10. use App\Enum\Source;
  11. #[ORM\Entity(repositoryClass: SeedRepository::class)]
  12. class Seed
  13. {
  14. #[ORM\Id]
  15. #[ORM\GeneratedValue]
  16. #[ORM\Column(type: Types::INTEGER, options:["unsigned" => true])]
  17. private ?int $id = null;
  18. #[ORM\Column(length: 50)]
  19. private Product $eProduct;
  20. #[ORM\Column(type: Types::DATETIME_MUTABLE)]
  21. private \DateTimeInterface $dtBegin;
  22. #[ORM\ManyToOne(inversedBy: 'seeds')]
  23. #[ORM\JoinColumn(name: "i_contact_fk", referencedColumnName: "i_id", nullable: true, onDelete: "CASCADE")]
  24. private ?Contact $contact = null;
  25. #[ORM\Column(length: 40)]
  26. private string $sPhpSession;
  27. #[ORM\Column(length: 50)]
  28. private Home $eHome;
  29. #[ORM\Column(length: 50)]
  30. private Source $eSource;
  31. #[ORM\Column(length: 50, nullable: true)]
  32. private ?string $sOrigin = null;
  33. #[ORM\Column(length: 50, nullable: true)]
  34. private ?string $sModel = null;
  35. #[ORM\Column(length: 50, nullable: true)]
  36. private ?string $sVersion = null;
  37. #[ORM\Column(length: 50, nullable: true)]
  38. private ?string $sObs = null;
  39. #[ORM\Column(length: 50, nullable: true)]
  40. private string $sIp;
  41. #[ORM\Column(length: 255, nullable: true)]
  42. private string $sUserAgent;
  43. #[ORM\Column(type: Types::TEXT, length: 65535, nullable: true)]
  44. private string $sHeader;
  45. #[ORM\Column(length: 255, nullable: true)]
  46. private ?string $sOriginToken = null;
  47. #[ORM\OneToMany(mappedBy: 'seed', targetEntity: Tracker::class)]
  48. private Collection $trackers;
  49. public function __construct(
  50. Product $eProduct,
  51. Home $eHome,
  52. Source $eSource,
  53. string $sPhpSession,
  54. string $sIp,
  55. string $sUserAgent,
  56. string $sHeader
  57. ) {
  58. $this->eProduct = $eProduct;
  59. $this->dtBegin = new \DateTimeImmutable();
  60. $this->eHome = $eHome;
  61. $this->eSource = $eSource;
  62. $this->sPhpSession = $sPhpSession;
  63. $this->sIp = $sIp;
  64. $this->sUserAgent = $sUserAgent;
  65. $this->sHeader = $sHeader;
  66. $this->trackers = new ArrayCollection();
  67. }
  68. public function getId(): ?int
  69. {
  70. return $this->id;
  71. }
  72. public function getEProduct(): Product
  73. {
  74. return $this->eProduct;
  75. }
  76. public function setEProduct(Product $eProduct): static
  77. {
  78. $this->eProduct = $eProduct;
  79. return $this;
  80. }
  81. public function getDtBegin(): \DateTimeInterface
  82. {
  83. return $this->dtBegin;
  84. }
  85. public function setDtBegin(\DateTimeInterface $dtBegin): static
  86. {
  87. $this->dtBegin = $dtBegin;
  88. return $this;
  89. }
  90. public function getContact(): ?Contact
  91. {
  92. return $this->contact;
  93. }
  94. public function setContact(Contact $contact): static
  95. {
  96. $this->contact = $contact;
  97. return $this;
  98. }
  99. public function getSPhpSession(): string
  100. {
  101. return $this->sPhpSession;
  102. }
  103. public function setSPhpSession(string $sPhpSession): static
  104. {
  105. $this->sPhpSession = $sPhpSession;
  106. return $this;
  107. }
  108. public function getEHome(): Home
  109. {
  110. return $this->eHome;
  111. }
  112. public function setEHome(Home $eHome): static
  113. {
  114. $this->eHome = $eHome;
  115. return $this;
  116. }
  117. public function getESource(): Source
  118. {
  119. return $this->eSource;
  120. }
  121. public function setESource(Source $eSource): static
  122. {
  123. $this->eSource = $eSource;
  124. return $this;
  125. }
  126. public function getSOrigin(): ?string
  127. {
  128. return $this->sOrigin;
  129. }
  130. public function setSOrigin(?string $sOrigin): static
  131. {
  132. $this->sOrigin = $sOrigin;
  133. return $this;
  134. }
  135. public function getSModel(): ?string
  136. {
  137. return $this->sModel;
  138. }
  139. public function setSModel(?string $sModel): static
  140. {
  141. $this->sModel = $sModel;
  142. return $this;
  143. }
  144. public function getSVersion(): ?string
  145. {
  146. return $this->sVersion;
  147. }
  148. public function setSVersion(?string $sVersion): static
  149. {
  150. $this->sVersion = $sVersion;
  151. return $this;
  152. }
  153. public function getSObs(): ?string
  154. {
  155. return $this->sObs;
  156. }
  157. public function setSObs(?string $sObs): static
  158. {
  159. $this->sObs = $sObs;
  160. return $this;
  161. }
  162. public function getSIp(): string
  163. {
  164. return $this->sIp;
  165. }
  166. public function setSIp(string $sIp): static
  167. {
  168. $this->sIp = $sIp;
  169. return $this;
  170. }
  171. public function getSUserAgent(): string
  172. {
  173. return $this->sUserAgent;
  174. }
  175. public function setSUserAgent(string $sUserAgent): static
  176. {
  177. $this->sUserAgent = $sUserAgent;
  178. return $this;
  179. }
  180. public function getSHeader(): string
  181. {
  182. return $this->sHeader;
  183. }
  184. public function setSHeader(string $sHeader): static
  185. {
  186. $this->sHeader = $sHeader;
  187. return $this;
  188. }
  189. public function getSOriginToken(): ?string
  190. {
  191. return $this->sOriginToken;
  192. }
  193. public function setSOriginToken(?string $sOriginToken): static
  194. {
  195. $this->sOriginToken = $sOriginToken;
  196. return $this;
  197. }
  198. public function getTrackers(): Collection
  199. {
  200. return $this->trackers;
  201. }
  202. }