<?php
namespace App\Entity;
use App\Repository\PcCriteriosRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity(repositoryClass: PcCriteriosRepository::class)]
class PcCriterios
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[Assert\NotBlank(message: "El nombre no puede estar vacío")]
#[Assert\Length(max: 255, maxMessage: "El nombre no puede superar los 255 caracteres")]
#[ORM\Column(type: 'string', length: 255, nullable:false)]
private $nombre;
#[Assert\Length(max: 800, maxMessage: "La descripción no puede superar los 800 caracteres")]
#[ORM\Column(type: 'string', length: 800, nullable:true)]
private $descripcion;
#[ORM\Column]
private ?array $puntajes = [];
#[ORM\OneToMany(mappedBy: 'criterios', targetEntity: "App\Entity\PcCriteriosConvocatorias")]
private Collection $criteriosConvocatorias;
public function __construct()
{
$this->criteriosConvocatorias = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNombre(): ?string
{
return $this->nombre;
}
public function setNombre(?string $nombre): self
{
$this->nombre = $nombre;
return $this;
}
public function getDescripcion(): ?string
{
return $this->descripcion;
}
public function setDescripcion(?string $descripcion): self
{
$this->descripcion = $descripcion;
return $this;
}
public function getPuntajes(): array
{
return $this->puntajes?? [];
}
public function setPuntajes(array $puntajes): self
{
$this->puntajes = $puntajes;
return $this;
}
public function __toString(){
return $this->getDescripcion();
}
}