<?php
namespace App\Entity;
use App\Repository\ParResultadoEntregaRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ParResultadoEntregaRepository::class)]
class ParResultadoEntrega {
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $nombre = null;
#[ORM\OneToMany(mappedBy: 'resultadoEntrega', targetEntity: RFOrdenCompra::class)]
private Collection $ordenCompra;
public function __toString(): string {
return $this->getNombre();
}
public function __construct() {
$this->ordenCompra = new ArrayCollection();
}
public function getId(): ?int {
return $this->id;
}
public function getNombre(): ?string {
return $this->nombre;
}
public function setNombre(string $nombre): static {
$this->nombre = $nombre;
return $this;
}
/**
* @return Collection<int, RFOrdenCompra>
*/
public function getOrdenCompra(): Collection {
return $this->ordenCompra;
}
public function addOrdenCompra(RFOrdenCompra $ordenCompra): static {
if (!$this->ordenCompra->contains($ordenCompra)) {
$this->ordenCompra->add($ordenCompra);
$ordenCompra->setResultadoEntrega($this);
}
return $this;
}
public function removeOrdenCompra(RFOrdenCompra $ordenCompra): static {
if ($this->ordenCompra->removeElement($ordenCompra)) {
// set the owning side to null (unless already changed)
if ($ordenCompra->getResultadoEntrega() === $this) {
$ordenCompra->setResultadoEntrega(null);
}
}
return $this;
}
}