src/Entity/App/TipoDestacado.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\App;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Entity\App\Categoria;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\App\TipoDestacadoRepository")
  8.  * @ORM\HasLifecycleCallbacks()
  9.  */
  10. class TipoDestacado
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @var string|null
  20.      *
  21.      * @ORM\Column(name="nombre", type="string", length=255)
  22.      * @Assert\NotBlank(message="El valor es requerido")
  23.      * @Assert\Length(
  24.      *      max = 255,
  25.      *      maxMessage = "La cantidad maxima es {{ limit }} caracteres"
  26.      * )
  27.      */
  28.     private $nombre;
  29.     /**
  30.      * @ORM\ManyToOne(targetEntity="App\Entity\App\Categoria", fetch="EAGER")
  31.      * @ORM\JoinColumn(nullable=true)
  32.      */
  33.     private $categoria;
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getNombre(): ?string
  39.     {
  40.         return $this->nombre;
  41.     }
  42.     public function setNombre(string $nombre): self
  43.     {
  44.         $this->nombre $nombre;
  45.         return $this;
  46.     }
  47.     public function getCategoria(): ?Categoria
  48.     {
  49.         return $this->categoria;
  50.     }
  51.     public function setCategoria(?Categoria $categoria): self
  52.     {
  53.         $this->categoria $categoria;
  54.         return $this;
  55.     }
  56. }