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