src/Entity/PcCriterios.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PcCriteriosRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. #[ORM\Entity(repositoryClassPcCriteriosRepository::class)]
  10. class PcCriterios
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     private ?int $id null;
  16.     #[Assert\NotBlank(message"El nombre no puede estar vacío")]
  17.     #[Assert\Length(max255maxMessage"El nombre no puede superar los 255 caracteres")]
  18.     #[ORM\Column(type'string'length255nullable:false)]
  19.     private $nombre;
  20.     #[Assert\Length(max800maxMessage"La descripción no puede superar los 800 caracteres")]
  21.     #[ORM\Column(type'string'length800nullable:true)]
  22.     private $descripcion;
  23.     #[ORM\Column]
  24.     private ?array $puntajes = [];
  25.     #[ORM\OneToMany(mappedBy'criterios'targetEntity"App\Entity\PcCriteriosConvocatorias")]
  26.     private Collection $criteriosConvocatorias;
  27.     public function __construct()
  28.     {
  29.         $this->criteriosConvocatorias = new ArrayCollection();
  30.     }
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getNombre(): ?string
  36.     {
  37.         return $this->nombre;
  38.     }
  39.     public function setNombre(?string $nombre): self
  40.     {
  41.         $this->nombre $nombre;
  42.         return $this;
  43.     }
  44.     public function getDescripcion(): ?string
  45.     {
  46.         return $this->descripcion;
  47.     }
  48.     public function setDescripcion(?string $descripcion): self
  49.     {
  50.         $this->descripcion $descripcion;
  51.         return $this;
  52.     }
  53.     public function getPuntajes(): array
  54.     {
  55.         return $this->puntajes?? [];
  56.     }
  57.     public function setPuntajes(array $puntajes): self
  58.     {
  59.         $this->puntajes $puntajes;
  60.         return $this;
  61.     }
  62.     public function __toString(){
  63.         return $this->getDescripcion();
  64.     }
  65. }