src/Entity/EstadoAbstract.php line 27

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