<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\GroupSequenceProviderInterface;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity(repositoryClass="App\Repository\HttParsingRepository")
* @ORM\Table(name="htt_parsing")
* @Gedmo\Loggable
*/
class HttParsing
{
/**
* @var int
*
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="datetime")
*/
private $cutOffDate;
/**
* @ORM\Column(type="boolean", options={"default":false})
*/
private $isPreview;
/**
* @ORM\Column(type="string", length=250, nullable=true)
* @Gedmo\Versioned
*/
private $urlExcel;
// Linked table
// -------------------------------------------------------------------------
/**
* @ORM\ManyToOne(targetEntity="App\Entity\PoolProgram", inversedBy="httParsings")
* @ORM\JoinColumn(name="poolId", referencedColumnName="id")
*/
private $pool;
/**
* @ORM\OneToMany(targetEntity="HttParsingValue", mappedBy="parsing")
*/
private $parsingValues;
// Auto filled column
// -------------------------------------------------------------------------
/**
* @Gedmo\Timestampable(on="create")
* @ORM\Column(type="datetime")
*/
private $createdOn;
/**
* @Gedmo\Timestampable(on="update")
* @ORM\Column(type="datetime")
*/
private $updatedOn;
/**
* @Gedmo\Blameable(on="create")
* @ORM\ManyToOne(targetEntity="App\Entity\User")
* @ORM\JoinColumn(referencedColumnName="id", nullable=true)
* @Gedmo\Versioned
*/
private $createdBy;
/**
* @Gedmo\Blameable(on="update")
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(referencedColumnName="id", nullable=true)
* @Gedmo\Versioned
*/
private $updatedBy;
public function __construct()
{
$this->parsingValues = new ArrayCollection();
}
// -------------------------------------------------------------------------
// Custom methods
public function __toString()
{
return $this->getPool()->__toString() . ' - ' . $this->getCutOffDate()->format("d/m/Y");
}
// -------------------------------------------------------------------------
// Auto generated methods
public function getId(): ?int
{
return $this->id;
}
public function getCutOffDate(): ?\DateTimeInterface
{
return $this->cutOffDate;
}
public function setCutOffDate(\DateTimeInterface $cutOffDate): self
{
$this->cutOffDate = $cutOffDate;
return $this;
}
public function getCreatedOn(): ?\DateTimeInterface
{
return $this->createdOn;
}
public function setCreatedOn(\DateTimeInterface $createdOn): self
{
$this->createdOn = $createdOn;
return $this;
}
public function getUpdatedOn(): ?\DateTimeInterface
{
return $this->updatedOn;
}
public function setUpdatedOn(\DateTimeInterface $updatedOn): self
{
$this->updatedOn = $updatedOn;
return $this;
}
public function getCreatedBy(): ?User
{
return $this->createdBy;
}
public function setCreatedBy(?User $createdBy): self
{
$this->createdBy = $createdBy;
return $this;
}
public function getUpdatedBy(): ?User
{
return $this->updatedBy;
}
public function setUpdatedBy(?User $updatedBy): self
{
$this->updatedBy = $updatedBy;
return $this;
}
/**
* @return Collection|HttParsingValue[]
*/
public function getParsingValues(): Collection
{
return $this->parsingValues;
}
public function addParsingValue(HttParsingValue $parsingValue): self
{
if (!$this->parsingValues->contains($parsingValue)) {
$this->parsingValues[] = $parsingValue;
$parsingValue->setParsing($this);
}
return $this;
}
public function removeParsingValue(HttParsingValue $parsingValue): self
{
if ($this->parsingValues->removeElement($parsingValue)) {
// set the owning side to null (unless already changed)
if ($parsingValue->getParsing() === $this) {
$parsingValue->setParsing(null);
}
}
return $this;
}
public function getIsPreview(): ?bool
{
return $this->isPreview;
}
public function setIsPreview(bool $isPreview): self
{
$this->isPreview = $isPreview;
return $this;
}
public function getPool(): ?PoolProgram
{
return $this->pool;
}
public function setPool(?PoolProgram $pool): self
{
$this->pool = $pool;
return $this;
}
public function isIsPreview(): ?bool
{
return $this->isPreview;
}
public function getUrlExcel(): ?string
{
return $this->urlExcel;
}
public function setUrlExcel(?string $urlExcel): self
{
$this->urlExcel = $urlExcel;
return $this;
}
}