src/Entity/Sites.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SitesRepository;
  4. use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * @ORM\Entity(repositoryClass=SitesRepository::class)
  10.  * @Auditable()
  11.  */
  12. class Sites
  13. {
  14.     /**
  15.      * @ORM\Id()
  16.      * @ORM\GeneratedValue()
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="string", length=255)
  22.      */
  23.     private $label;
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity="App\Entity\Sites")
  26.      * @ORM\JoinColumn(nullable=true)
  27.      */
  28.     private $parent;
  29.     /**
  30.      * @ORM\Column(type="boolean", nullable=true)
  31.      */
  32.     private $isDeleted;
  33.     /**
  34.      * @ORM\Column(type="datetime", nullable=true)
  35.      */
  36.     private $dateUpdate;
  37.     /**
  38.      * @ORM\Column(type="datetime", nullable=true)
  39.      */
  40.     private $dateCreate;
  41.     /**
  42.      * @ORM\ManyToOne(targetEntity=Users::class)
  43.      */
  44.     private $userCreate;
  45.     /**
  46.      * @ORM\ManyToOne(targetEntity=Users::class)
  47.      */
  48.     private $userUpdate;
  49.     /**
  50.      * @ORM\ManyToOne(targetEntity=Pcode::class)
  51.      */
  52.     private $pcode;
  53.     /**
  54.      * @ORM\Column(type="string", length=255, nullable=true)
  55.      */
  56.     private $authorityName;
  57.     /**
  58.      * @ORM\Column(type="string", length=255, nullable=true)
  59.      */
  60.     private $signatureFile;
  61.     /**
  62.      * @ORM\OneToMany(targetEntity=Report::class, mappedBy="site")
  63.      */
  64.     private $reports;
  65.     /**
  66.      * @ORM\ManyToOne(targetEntity=TypeSite::class)
  67.      */
  68.     private $typeSite;
  69.     public function __construct()
  70.     {
  71.         $this->isDeleted false;
  72.         $this->dateCreate = new \DateTime();
  73.         $this->reports = new ArrayCollection();
  74.     }
  75.     public function setId(int $id): self{
  76.         $this->id $id;
  77.         return $this;
  78.     }
  79.     
  80.     public function getId(): ?int
  81.     {
  82.         return $this->id;
  83.     }
  84.     public function getLabel(): ?string
  85.     {
  86.         return $this->label;
  87.     }
  88.     public function setLabel(string $label): self
  89.     {
  90.         $this->label $label;
  91.         return $this;
  92.     }
  93.     public function getParent(): ?self
  94.     {
  95.         return $this->parent;
  96.     }
  97.     public function setParent(?self $parent): self
  98.     {
  99.         $this->parent $parent;
  100.         return $this;
  101.     }
  102.     public function getIsDeleted(): ?bool
  103.     {
  104.         return $this->isDeleted;
  105.     }
  106.     public function setIsDeleted(?bool $isDeleted): self
  107.     {
  108.         $this->isDeleted $isDeleted;
  109.         return $this;
  110.     }
  111.     public function getDateUpdate(): ?\DateTimeInterface
  112.     {
  113.         return $this->dateUpdate;
  114.     }
  115.     public function setDateUpdate(?\DateTimeInterface $dateUpdate): self
  116.     {
  117.         $this->dateUpdate $dateUpdate;
  118.         return $this;
  119.     }
  120.     public function getDateCreate(): ?\DateTimeInterface
  121.     {
  122.         return $this->dateCreate;
  123.     }
  124.     public function setDateCreate(?\DateTimeInterface $dateCreate): self
  125.     {
  126.         $this->dateCreate $dateCreate;
  127.         return $this;
  128.     }
  129.     public function getUserCreate(): ?Users
  130.     {
  131.         return $this->userCreate;
  132.     }
  133.     public function setUserCreate(?Users $userCreate): self
  134.     {
  135.         $this->userCreate $userCreate;
  136.         return $this;
  137.     }
  138.     public function getUserUpdate(): ?Users
  139.     {
  140.         return $this->userUpdate;
  141.     }
  142.     public function setUserUpdate(?Users $userUpdate): self
  143.     {
  144.         $this->userUpdate $userUpdate;
  145.         return $this;
  146.     }
  147.     public function getPcode(): ?Pcode
  148.     {
  149.         return $this->pcode;
  150.     }
  151.     public function setPcode(?Pcode $pcode): self
  152.     {
  153.         $this->pcode $pcode;
  154.         return $this;
  155.     }
  156.     public function getAuthorityName(): ?string
  157.     {
  158.         return $this->authorityName;
  159.     }
  160.     public function setAuthorityName(?string $authorityName): self
  161.     {
  162.         $this->authorityName $authorityName;
  163.         return $this;
  164.     }
  165.     public function getSignatureFile(): ?string
  166.     {
  167.         return $this->signatureFile;
  168.     }
  169.     public function setSignatureFile(?string $signatureFile): self
  170.     {
  171.         $this->signatureFile $signatureFile;
  172.         return $this;
  173.     }
  174.     /**
  175.      * @return Collection|Report[]
  176.      */
  177.     public function getReports(): Collection
  178.     {
  179.         return $this->reports;
  180.     }
  181.     public function addReport(Report $report): self
  182.     {
  183.         if (!$this->reports->contains($report)) {
  184.             $this->reports[] = $report;
  185.             $report->setSite($this);
  186.         }
  187.         return $this;
  188.     }
  189.     public function removeReport(Report $report): self
  190.     {
  191.         if ($this->reports->removeElement($report)) {
  192.             // set the owning side to null (unless already changed)
  193.             if ($report->getSite() === $this) {
  194.                 $report->setSite(null);
  195.             }
  196.         }
  197.         return $this;
  198.     }
  199.     public function getTypeSite(): ?TypeSite
  200.     {
  201.         return $this->typeSite;
  202.     }
  203.     public function setTypeSite(?TypeSite $typeSite): self
  204.     {
  205.         $this->typeSite $typeSite;
  206.         return $this;
  207.     }
  208. }