src/Entity/EstadoAbstract.php line 26

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. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  7. /**
  8.  * @ORM\Entity(repositoryClass="App\Repository\EstadoAbstractRepository")
  9.  * @ORM\Table(name="estado", schema="perseo")
  10.  * @UniqueEntity(fields={"key"})
  11.  * @ORM\InheritanceType("SINGLE_TABLE")
  12.  * @ORM\DiscriminatorColumn(name="type", type="string")
  13.  * @ORM\DiscriminatorMap({
  14.  *     "valoracion":"App\Entity\EstadoValoracion",
  15.  *     "reloj":"App\Entity\EstadoReloj",
  16.  *     "operacion":"App\Entity\EstadoOperacion",
  17.  *     "aspecto":"App\Entity\EstadoAspecto",
  18.  *     "check":"App\Entity\EstadoCheck",
  19.  *     "actividad":"App\Entity\EstadoActividad"
  20.  * })
  21.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  22.  */
  23. Abstract class EstadoAbstract
  24. {
  25.     /**
  26.      * @ORM\Id
  27.      * @ORM\Column(type="bigint")
  28.      * @ORM\GeneratedValue(strategy="AUTO")
  29.      */
  30.     protected $id;
  31.     /**
  32.      * @ORM\Column(type="string", nullable=false, name="key_estado")
  33.      */
  34.     protected $key;
  35.     /**
  36.      * @ORM\Column(type="string", nullable=false)
  37.      */
  38.     protected $nombre;
  39.     /**
  40.      * @ORM\Column(type="string", nullable=true)
  41.      */
  42.     protected $icono;
  43.     /**
  44.      * @ORM\Column(type="string", nullable=true)
  45.      */
  46.     protected $color;
  47.     /**
  48.      * @ORM\Column(type="smallint", nullable=false, options={"default":1,"unsigned":true})
  49.      */
  50.     protected $orden;
  51.     /**
  52.      * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  53.      */
  54.     protected $deletedAt;
  55.     /**
  56.      * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2019-01-01 00:00:00"})
  57.      * @Gedmo\Timestampable(on="update")
  58.      */
  59.     protected $updatedAt;
  60.     /**
  61.      * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2019-01-01 00:00:00"})
  62.      * @Gedmo\Timestampable(on="create")
  63.      */
  64.     protected $createdAt;
  65.     public function __toString(): string
  66.     {
  67.         return $this->getNombre();
  68.     }
  69.     public function getId(): ?string
  70.     {
  71.         return $this->id;
  72.     }
  73.     public function getKey(): ?string
  74.     {
  75.         return $this->key;
  76.     }
  77.     public function setKey(string $key): self
  78.     {
  79.         $this->key $key;
  80.         return $this;
  81.     }
  82.     public function getNombre(): ?string
  83.     {
  84.         return $this->nombre;
  85.     }
  86.     public function setNombre(string $nombre): self
  87.     {
  88.         $this->nombre $nombre;
  89.         return $this;
  90.     }
  91.     public function getIcono(): ?string
  92.     {
  93.         return $this->icono;
  94.     }
  95.     public function setIcono(?string $icono): self
  96.     {
  97.         $this->icono $icono;
  98.         return $this;
  99.     }
  100.     public function getColor(): ?string
  101.     {
  102.         return $this->color;
  103.     }
  104.     public function setColor(?string $color): self
  105.     {
  106.         $this->color $color;
  107.         return $this;
  108.     }
  109.     public function getOrden(): ?int
  110.     {
  111.         return $this->orden;
  112.     }
  113.     public function setOrden(int $orden): self
  114.     {
  115.         $this->orden $orden;
  116.         return $this;
  117.     }
  118.     public function getDeletedAt(): ?\DateTimeInterface
  119.     {
  120.         return $this->deletedAt;
  121.     }
  122.     public function setDeletedAt(?\DateTimeInterface $deletedAt): self
  123.     {
  124.         $this->deletedAt $deletedAt;
  125.         return $this;
  126.     }
  127.     public function getUpdatedAt(): ?\DateTimeInterface
  128.     {
  129.         return $this->updatedAt;
  130.     }
  131.     public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  132.     {
  133.         $this->updatedAt $updatedAt;
  134.         return $this;
  135.     }
  136.     public function getCreatedAt(): ?\DateTimeInterface
  137.     {
  138.         return $this->createdAt;
  139.     }
  140.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  141.     {
  142.         $this->createdAt $createdAt;
  143.         return $this;
  144.     }
  145. }