src/Entity/DocumentType.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DocumentTypeRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. /**
  9.  * @ORM\Entity(repositoryClass=DocumentTypeRepository::class)
  10.  * @ORM\Table(name="69pixl_document_type")
  11.  */
  12. class DocumentType
  13. {
  14.     /**
  15.      * @ORM\PrePersist
  16.      */
  17.     public function prePersist()
  18.     {
  19.         $this->dateCreated = new \DateTime();
  20.     }
  21.     
  22.     /**
  23.      * @ORM\Id
  24.      * @ORM\GeneratedValue
  25.      * @ORM\Column(type="integer")
  26.      */
  27.     private $id;
  28.     /**
  29.      * @Groups({"type_group"})
  30.      * @ORM\Column(type="string", length=255, nullable=true)
  31.      */
  32.     private $name;
  33.     /**
  34.      * @ORM\Column(type="integer", nullable=true)
  35.      */
  36.     private $number_page;
  37.     /**
  38.      * @ORM\Column(type="boolean", nullable=true)
  39.      */
  40.     private $signed_order;
  41.     /**
  42.      * @ORM\Column(name="date_created", type="datetime", nullable=true)
  43.      */
  44.     protected $dateCreated;
  45.     /**
  46.      * @var fileAttribute[]
  47.      * @ORM\OneToMany(targetEntity="App\Entity\Cp", mappedBy="fileType")
  48.      */
  49.     protected $fileAttribute;
  50.     /**
  51.      * @ORM\OneToMany(targetEntity="App\Entity\SignatoryDocType", mappedBy="docType")
  52.      */
  53.     protected $docTypeSignatory;
  54.     public function __construct()
  55.     {
  56.         $this->fileAttribute = new ArrayCollection();
  57.         $this->docTypeSignatory = new ArrayCollection();
  58.     }
  59.     public function getId(): ?int
  60.     {
  61.         return $this->id;
  62.     }
  63.     public function getName(): ?string
  64.     {
  65.         return $this->name;
  66.     }
  67.     public function setName(?string $name): self
  68.     {
  69.         $this->name $name;
  70.         return $this;
  71.     }
  72.     public function getNumberPage(): ?int
  73.     {
  74.         return $this->number_page;
  75.     }
  76.     public function setNumberPage(?int $number_page): self
  77.     {
  78.         $this->number_page $number_page;
  79.         return $this;
  80.     }
  81.     public function isSignedOrder(): ?bool
  82.     {
  83.         return $this->signed_order;
  84.     }
  85.     public function setSignedOrder(?bool $signed_order): self
  86.     {
  87.         $this->signed_order $signed_order;
  88.         return $this;
  89.     }
  90.     public function getDateCreated(): ?\DateTimeInterface
  91.     {
  92.         return $this->dateCreated;
  93.     }
  94.     public function setDateCreated(?\DateTimeInterface $dateCreated): self
  95.     {
  96.         $this->dateCreated $dateCreated;
  97.         return $this;
  98.     }
  99.     /**
  100.      * @return Collection|Cp[]
  101.      */
  102.     public function getFileAttribute(): Collection
  103.     {
  104.         return $this->fileAttribute;
  105.     }
  106.     public function addFileAttribute(Cp $file): self
  107.     {
  108.         if (!$this->fileAttribute->contains($file)) {
  109.             $this->fileAttribute[] = $file;
  110.             $file->setFileType($this);
  111.         }
  112.         return $this;
  113.     }
  114.     public function removeFileAttribute(Cp $file): self
  115.     {
  116.         if ($this->fileAttribute->removeElement($file)) {
  117.             // set the owning side to null (unless already changed)
  118.             if ($file->getFileType() === $this) {
  119.                 $file->setFileType(null);
  120.             }
  121.         }
  122.         return $this;
  123.     }
  124.     public function getDocTypeSignatory(): Collection
  125.     {
  126.         return $this->docTypeSignatory;
  127.     }
  128.     public function addDocTypeSignatory(SignatoryDocType $file): self
  129.     {
  130.         if (!$this->docTypeSignatory->contains($file)) {
  131.             $this->docTypeSignatory[] = $file;
  132.             $file->setDocType($this);
  133.         }
  134.         return $this;
  135.     }
  136.     public function removeDocTypeSignatory(SignatoryDocType $file): self
  137.     {
  138.         if ($this->docTypeSignatory->removeElement($file)) {
  139.             // set the owning side to null (unless already changed)
  140.             if ($file->getDocType() === $this) {
  141.                 $file->setDocType(null);
  142.             }
  143.         }
  144.         return $this;
  145.     }
  146. }