<?php
namespace App\Entity;
use App\Repository\SeedRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use App\Enum\Product;
use App\Enum\Home;
use App\Enum\Source;
#[ORM\Entity(repositoryClass: SeedRepository::class)]
class Seed
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: Types::INTEGER, options:["unsigned" => true])]
private ?int $id = null;
#[ORM\Column(length: 50)]
private Product $eProduct;
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
private \DateTimeInterface $dtBegin;
#[ORM\ManyToOne(inversedBy: 'seeds')]
#[ORM\JoinColumn(name: "i_contact_fk", referencedColumnName: "i_id", nullable: true, onDelete: "CASCADE")]
private ?Contact $contact = null;
#[ORM\Column(length: 40)]
private string $sPhpSession;
#[ORM\Column(length: 50)]
private Home $eHome;
#[ORM\Column(length: 50)]
private Source $eSource;
#[ORM\Column(length: 50, nullable: true)]
private ?string $sOrigin = null;
#[ORM\Column(length: 50, nullable: true)]
private ?string $sModel = null;
#[ORM\Column(length: 50, nullable: true)]
private ?string $sVersion = null;
#[ORM\Column(length: 50, nullable: true)]
private ?string $sObs = null;
#[ORM\Column(length: 50, nullable: true)]
private string $sIp;
#[ORM\Column(length: 255, nullable: true)]
private string $sUserAgent;
#[ORM\Column(type: Types::TEXT, length: 65535, nullable: true)]
private string $sHeader;
#[ORM\Column(length: 255, nullable: true)]
private ?string $sOriginToken = null;
#[ORM\OneToMany(mappedBy: 'seed', targetEntity: Tracker::class)]
private Collection $trackers;
public function __construct(
Product $eProduct,
Home $eHome,
Source $eSource,
string $sPhpSession,
string $sIp,
string $sUserAgent,
string $sHeader
) {
$this->eProduct = $eProduct;
$this->dtBegin = new \DateTimeImmutable();
$this->eHome = $eHome;
$this->eSource = $eSource;
$this->sPhpSession = $sPhpSession;
$this->sIp = $sIp;
$this->sUserAgent = $sUserAgent;
$this->sHeader = $sHeader;
$this->trackers = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getEProduct(): Product
{
return $this->eProduct;
}
public function setEProduct(Product $eProduct): static
{
$this->eProduct = $eProduct;
return $this;
}
public function getDtBegin(): \DateTimeInterface
{
return $this->dtBegin;
}
public function setDtBegin(\DateTimeInterface $dtBegin): static
{
$this->dtBegin = $dtBegin;
return $this;
}
public function getContact(): ?Contact
{
return $this->contact;
}
public function setContact(Contact $contact): static
{
$this->contact = $contact;
return $this;
}
public function getSPhpSession(): string
{
return $this->sPhpSession;
}
public function setSPhpSession(string $sPhpSession): static
{
$this->sPhpSession = $sPhpSession;
return $this;
}
public function getEHome(): Home
{
return $this->eHome;
}
public function setEHome(Home $eHome): static
{
$this->eHome = $eHome;
return $this;
}
public function getESource(): Source
{
return $this->eSource;
}
public function setESource(Source $eSource): static
{
$this->eSource = $eSource;
return $this;
}
public function getSOrigin(): ?string
{
return $this->sOrigin;
}
public function setSOrigin(?string $sOrigin): static
{
$this->sOrigin = $sOrigin;
return $this;
}
public function getSModel(): ?string
{
return $this->sModel;
}
public function setSModel(?string $sModel): static
{
$this->sModel = $sModel;
return $this;
}
public function getSVersion(): ?string
{
return $this->sVersion;
}
public function setSVersion(?string $sVersion): static
{
$this->sVersion = $sVersion;
return $this;
}
public function getSObs(): ?string
{
return $this->sObs;
}
public function setSObs(?string $sObs): static
{
$this->sObs = $sObs;
return $this;
}
public function getSIp(): string
{
return $this->sIp;
}
public function setSIp(string $sIp): static
{
$this->sIp = $sIp;
return $this;
}
public function getSUserAgent(): string
{
return $this->sUserAgent;
}
public function setSUserAgent(string $sUserAgent): static
{
$this->sUserAgent = $sUserAgent;
return $this;
}
public function getSHeader(): string
{
return $this->sHeader;
}
public function setSHeader(string $sHeader): static
{
$this->sHeader = $sHeader;
return $this;
}
public function getSOriginToken(): ?string
{
return $this->sOriginToken;
}
public function setSOriginToken(?string $sOriginToken): static
{
$this->sOriginToken = $sOriginToken;
return $this;
}
public function getTrackers(): Collection
{
return $this->trackers;
}
}