<?php
namespace App\Entity;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* @ORM\Entity(repositoryClass="App\Repository\EstadoAbstractRepository")
* @ORM\Table(name="estado", schema="perseo")
* @UniqueEntity(fields={"key"})
* @ORM\InheritanceType("SINGLE_TABLE")
* @ORM\DiscriminatorColumn(name="type", type="string")
* @ORM\DiscriminatorMap({
* "valoracion":"App\Entity\EstadoValoracion",
* "reloj":"App\Entity\EstadoReloj",
* "operacion":"App\Entity\EstadoOperacion",
* "aspecto":"App\Entity\EstadoAspecto",
* "check":"App\Entity\EstadoCheck",
* "actividad":"App\Entity\EstadoActividad"
* })
* @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
*/
Abstract class EstadoAbstract
{
/**
* @ORM\Id
* @ORM\Column(type="bigint")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(type="string", nullable=false, name="key_estado")
*/
protected $key;
/**
* @ORM\Column(type="string", nullable=false)
*/
protected $nombre;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $icono;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $color;
/**
* @ORM\Column(type="smallint", nullable=false, options={"default":1,"unsigned":true})
*/
protected $orden;
/**
* @ORM\Column(type="datetime", nullable=true, name="deleted_at")
*/
protected $deletedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2019-01-01 00:00:00"})
* @Gedmo\Timestampable(on="update")
*/
protected $updatedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2019-01-01 00:00:00"})
* @Gedmo\Timestampable(on="create")
*/
protected $createdAt;
public function __toString(): string
{
return $this->getNombre();
}
public function getId(): ?string
{
return $this->id;
}
public function getKey(): ?string
{
return $this->key;
}
public function setKey(string $key): self
{
$this->key = $key;
return $this;
}
public function getNombre(): ?string
{
return $this->nombre;
}
public function setNombre(string $nombre): self
{
$this->nombre = $nombre;
return $this;
}
public function getIcono(): ?string
{
return $this->icono;
}
public function setIcono(?string $icono): self
{
$this->icono = $icono;
return $this;
}
public function getColor(): ?string
{
return $this->color;
}
public function setColor(?string $color): self
{
$this->color = $color;
return $this;
}
public function getOrden(): ?int
{
return $this->orden;
}
public function setOrden(int $orden): self
{
$this->orden = $orden;
return $this;
}
public function getDeletedAt(): ?\DateTimeInterface
{
return $this->deletedAt;
}
public function setDeletedAt(?\DateTimeInterface $deletedAt): self
{
$this->deletedAt = $deletedAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
}