<?php
namespace App\Entity;
use App\Repository\NumeracionRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=NumeracionRepository::class)
* @ORM\Table(name="numeracion",indexes={@ORM\Index(name="numero_idx", columns={"numero"})}))
*/
class Numeracion
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=5)
*/
private $numero;
/**
* @ORM\Column(type="integer")
*/
private $stock;
/**
* @ORM\ManyToOne(targetEntity=Sorteo::class, inversedBy="numeraciones")
* @ORM\JoinColumn(nullable=false)
*/
private $sorteo;
public function __construct()
{
}
public function __toString(): string
{
return $this->getSorteo() . ': ' . $this->getNumero();
}
public function getId(): ?int
{
return $this->id;
}
public function getNumero(): ?string
{
return $this->numero;
}
public function setNumero(string $numero): self
{
$this->numero = $numero;
return $this;
}
public function getStock(): ?int
{
return $this->stock;
}
public function setStock(int $stock): self
{
$this->stock = $stock;
return $this;
}
public function getSorteo(): ?Sorteo
{
return $this->sorteo;
}
public function setSorteo(?Sorteo $sorteo): self
{
$this->sorteo = $sorteo;
return $this;
}
}