src/Entity/App/Etiqueta.php line 28

Open in your IDE?
  1. <?php
  2. namespace App\Entity\App;
  3. use App\Utils\Traits\ActivoTrait;
  4. use App\Utils\Traits\PosicionTrait;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Mapping\Annotation as Gedmo;
  7. use Gedmo\SoftDeleteable\Traits\SoftDeleteableEntity;
  8. use Gedmo\Timestampable\Traits\TimestampableEntity;
  9. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  10. use Symfony\Component\Validator\Constraints as Assert;
  11. /**
  12.  * @ORM\Entity(repositoryClass="App\Repository\App\EtiquetaRepository")
  13.  * @ORM\HasLifecycleCallbacks()
  14.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false)
  15.  * @UniqueEntity(
  16.  *      fields={"nombre"},
  17.  *      message="El nombre ya está en uso. Por favor, elige otro."
  18.  *  )
  19.  * @UniqueEntity(
  20.  *      fields={"ruta"},
  21.  *      message="La ruta ya está en uso. Por favor, elige otra."
  22.  *  )
  23.  * /
  24.  */
  25. class Etiqueta
  26. {
  27.     /**
  28.      * @var integer|null
  29.      * @ORM\Id
  30.      * @ORM\GeneratedValue(strategy="AUTO")
  31.      * @ORM\Column(type="integer")
  32.      */
  33.     private $id;
  34.     /**
  35.      * @var string|null
  36.      * @ORM\Column(type="string", name="nombre")
  37.      * @ORM\Column(type="string", nullable=false)
  38.      * @Assert\Length(
  39.      *  max = 30,
  40.      *  maxMessage = "La cantidad maxima es {{ limit }} caracteres"
  41.      *  )
  42.      */
  43.     private ?string $nombre;
  44.     /**
  45.      * @var string|null
  46.      * @ORM\Column(type="string", name="ruta", nullable=true)
  47.      * @Assert\Length(
  48.      *  max = 5000,
  49.      *  maxMessage = "La cantidad maxima es {{ limit }} caracteres"
  50.      *  )
  51.      */
  52.     private ?string $ruta;
  53.     public function getId(): ?int
  54.     {
  55.         return $this->id;
  56.     }
  57.     public function setId(?int $id): void
  58.     {
  59.         $this->id $id;
  60.     }
  61.     public function getNombre(): ?string
  62.     {
  63.         return $this->nombre;
  64.     }
  65.     public function setNombre(?string $nombre): void
  66.     {
  67.         $this->nombre $nombre;
  68.     }
  69.     public function getRuta(): ?string
  70.     {
  71.         return $this->ruta;
  72.     }
  73.     public function setRuta(?string $ruta): void
  74.     {
  75.         $this->ruta $ruta;
  76.     }
  77.     use ActivoTrait;
  78.     use PosicionTrait;
  79.     use TimestampableEntity;
  80.     use SoftDeleteableEntity;
  81. }