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_valoracion_serialize",
  33.      *      "api_v1_operacion_show_serialize"
  34.      * })
  35.      */
  36.     protected $id;
  37.     /**
  38.      * @ORM\Column(type="string", nullable=false, name="key_estado")
  39.      * @JMS\Groups({
  40.      *       "api_v1_estado_serialize",
  41.      *       "api_v1_valoracion_serialize",
  42.      *       "api_v1_operacion_show_serialize"
  43.      *  })
  44.      */
  45.     protected $key;
  46.     /**
  47.      * @ORM\Column(type="string", nullable=false)
  48.      * @JMS\Groups({
  49.      *       "api_v1_estado_serialize",
  50.      *       "api_v1_valoracion_serialize",
  51.      *       "api_v1_operacion_show_serialize"
  52.      *  })
  53.      */
  54.     protected $nombre;
  55.     /**
  56.      * @ORM\Column(type="string", nullable=true)
  57.      */
  58.     protected $icono;
  59.     /**
  60.      * @ORM\Column(type="string", nullable=true)
  61.      */
  62.     protected $color;
  63.     /**
  64.      * @ORM\Column(type="smallint", nullable=false, options={"default":1,"unsigned":true})
  65.      */
  66.     protected $orden;
  67.     /**
  68.      * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  69.      * @JMS\Groups({
  70.      *       "api_v1_estado_serialize",
  71.      *       "api_v1_valoracion_serialize",
  72.      *       "api_v1_operacion_show_serialize"
  73.      *  })
  74.      */
  75.     protected $deletedAt;
  76.     /**
  77.      * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2019-01-01 00:00:00"})
  78.      * @Gedmo\Timestampable(on="update")
  79.      */
  80.     protected $updatedAt;
  81.     /**
  82.      * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2019-01-01 00:00:00"})
  83.      * @Gedmo\Timestampable(on="create")
  84.      */
  85.     protected $createdAt;
  86.     public function __toString(): string
  87.     {
  88.         return $this->getNombre();
  89.     }
  90.     public function getId(): ?string
  91.     {
  92.         return $this->id;
  93.     }
  94.     public function getKey(): ?string
  95.     {
  96.         return $this->key;
  97.     }
  98.     public function setKey(string $key): self
  99.     {
  100.         $this->key $key;
  101.         return $this;
  102.     }
  103.     public function getNombre(): ?string
  104.     {
  105.         return $this->nombre;
  106.     }
  107.     public function setNombre(string $nombre): self
  108.     {
  109.         $this->nombre $nombre;
  110.         return $this;
  111.     }
  112.     public function getIcono(): ?string
  113.     {
  114.         return $this->icono;
  115.     }
  116.     public function setIcono(?string $icono): self
  117.     {
  118.         $this->icono $icono;
  119.         return $this;
  120.     }
  121.     public function getColor(): ?string
  122.     {
  123.         return $this->color;
  124.     }
  125.     public function setColor(?string $color): self
  126.     {
  127.         $this->color $color;
  128.         return $this;
  129.     }
  130.     public function getOrden(): ?int
  131.     {
  132.         return $this->orden;
  133.     }
  134.     public function setOrden(int $orden): self
  135.     {
  136.         $this->orden $orden;
  137.         return $this;
  138.     }
  139.     public function getDeletedAt(): ?\DateTimeInterface
  140.     {
  141.         return $this->deletedAt;
  142.     }
  143.     public function setDeletedAt(?\DateTimeInterface $deletedAt): self
  144.     {
  145.         $this->deletedAt $deletedAt;
  146.         return $this;
  147.     }
  148.     public function getUpdatedAt(): ?\DateTimeInterface
  149.     {
  150.         return $this->updatedAt;
  151.     }
  152.     public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  153.     {
  154.         $this->updatedAt $updatedAt;
  155.         return $this;
  156.     }
  157.     public function getCreatedAt(): ?\DateTimeInterface
  158.     {
  159.         return $this->createdAt;
  160.     }
  161.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  162.     {
  163.         $this->createdAt $createdAt;
  164.         return $this;
  165.     }
  166. }