src/Entity/PlantillaAbstract.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\DBAL\Types\Types;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\PlantillaAbstractRepository")
  8.  * @ORM\Table(name="plantilla")
  9.  * @ORM\InheritanceType("SINGLE_TABLE")
  10.  * @ORM\DiscriminatorColumn(name="type", type="string")
  11.  * @ORM\DiscriminatorMap({
  12.  *     "correo":"App\Entity\PlantillaCorreo",
  13.  *     "contrato":"App\Entity\PlantillaContrato"
  14.  * })
  15.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  16.  */
  17. abstract class PlantillaAbstract
  18. {
  19.     /**
  20.      * @ORM\Id
  21.      * @ORM\Column(type="bigint", options={"unsigned":true})
  22.      * @ORM\GeneratedValue(strategy="AUTO")
  23.      */
  24.     protected $id;
  25.     /**
  26.      * @ORM\Column(type="string", nullable=true)
  27.      */
  28.     protected $tipo;
  29.     /**
  30.      * @ORM\Column(type="string", length=2, nullable=true)
  31.      */
  32.     protected $idioma;
  33.     /**
  34.      * @ORM\Column(type="string", nullable=true)
  35.      */
  36.     private $alias;
  37.     /**
  38.      * @ORM\Column(type="string", nullable=true)
  39.      */
  40.     private $nombre;
  41.     /**
  42.      * @ORM\Column(type="string", nullable=true)
  43.      */
  44.     private $filename;
  45.     /**
  46.      * @ORM\Column(type="text", nullable=true)
  47.      */
  48.     protected $source;
  49.     /**
  50.      * @ORM\Column(type="text", nullable=true)
  51.      */
  52.     private $descripcion;
  53.     /**
  54.      * @ORM\Column(type="boolean", nullable=true)
  55.      */
  56.     private $active;
  57.     /**
  58.      * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  59.      */
  60.     protected $deletedAt;
  61.     /**
  62.      * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2022-01-01 00:00:00"})
  63.      * @Gedmo\Timestampable(on="update")
  64.      */
  65.     protected $updatedAt;
  66.     /**
  67.      * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2022-01-01 00:00:00"})
  68.      * @Gedmo\Timestampable(on="create")
  69.      */
  70.     protected $createdAt;
  71.     /**
  72.      * @ORM\ManyToOne(targetEntity=\App\Entity\Empresa::class, inversedBy="plantillas")
  73.      * @ORM\JoinColumn(name="empresa_id", referencedColumnName="id", nullable=false)
  74.      */
  75.     protected $empresa;
  76.     public function __toString(): string
  77.     {
  78.         return $this->getAlias().'';
  79.     }
  80.     public function getId(): ?string
  81.     {
  82.         return $this->id;
  83.     }
  84.     public function getFilename(): ?string
  85.     {
  86.         return $this->filename;
  87.     }
  88.     public function setFilename(?string $filename): self
  89.     {
  90.         $this->filename $filename;
  91.         return $this;
  92.     }
  93.     public function getSource(): ?string
  94.     {
  95.         return $this->source;
  96.     }
  97.     public function setSource(?string $source): self
  98.     {
  99.         $this->source $source;
  100.         return $this;
  101.     }
  102.     public function getIdioma(): ?string
  103.     {
  104.         return $this->idioma;
  105.     }
  106.     public function setIdioma(?string $idioma): self
  107.     {
  108.         $this->idioma $idioma;
  109.         return $this;
  110.     }
  111.     public function getDeletedAt(): ?\DateTimeInterface
  112.     {
  113.         return $this->deletedAt;
  114.     }
  115.     public function setDeletedAt(?\DateTimeInterface $deletedAt): self
  116.     {
  117.         $this->deletedAt $deletedAt;
  118.         return $this;
  119.     }
  120.     public function getUpdatedAt(): ?\DateTimeInterface
  121.     {
  122.         return $this->updatedAt;
  123.     }
  124.     public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  125.     {
  126.         $this->updatedAt $updatedAt;
  127.         return $this;
  128.     }
  129.     public function getCreatedAt(): ?\DateTimeInterface
  130.     {
  131.         return $this->createdAt;
  132.     }
  133.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  134.     {
  135.         $this->createdAt $createdAt;
  136.         return $this;
  137.     }
  138.     public function getAlias(): ?string
  139.     {
  140.         return $this->alias;
  141.     }
  142.     public function setAlias(?string $alias): self
  143.     {
  144.         $this->alias $alias;
  145.         return $this;
  146.     }
  147.     public function getDescripcion(): ?string
  148.     {
  149.         return $this->descripcion;
  150.     }
  151.     public function setDescripcion(?string $descripcion): static
  152.     {
  153.         $this->descripcion $descripcion;
  154.         return $this;
  155.     }
  156.     public function isActive(): ?bool
  157.     {
  158.         return $this->active;
  159.     }
  160.     public function setActive(?bool $active): static
  161.     {
  162.         $this->active $active;
  163.         return $this;
  164.     }
  165.     public function getNombre(): ?string
  166.     {
  167.         return $this->nombre;
  168.     }
  169.     public function setNombre(?string $nombre): static
  170.     {
  171.         $this->nombre $nombre;
  172.         return $this;
  173.     }
  174.     public function getTipo(): ?string
  175.     {
  176.         return $this->tipo;
  177.     }
  178.     public function setTipo(?string $tipo): static
  179.     {
  180.         $this->tipo $tipo;
  181.         return $this;
  182.     }
  183.     public function getEmpresa(): ?Empresa
  184.     {
  185.         return $this->empresa;
  186.     }
  187.     public function setEmpresa(?Empresa $empresa): static
  188.     {
  189.         $this->empresa $empresa;
  190.         return $this;
  191.     }
  192. }