<?phpnamespace App\Entity;use App\Repository\EstadoComisionRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=EstadoComisionRepository::class) */class EstadoComision{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $nombre; /** * @ORM\OneToMany(targetEntity=Contrato::class, mappedBy="comisionCobrada") */ private $contratosCobrados; /** * @ORM\OneToMany(targetEntity=Contrato::class, mappedBy="comisionPagada") */ private $contratosPagados; public function __construct() { $this->contratosCobrados = new ArrayCollection(); $this->contratosPagados = 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; } /** * @return Collection|Contrato[] */ public function getContratosCobrados(): Collection { return $this->contratosCobrados; } public function addContratosCobrado(Contrato $contratosCobrado): self { if (!$this->contratosCobrados->contains($contratosCobrado)) { $this->contratosCobrados[] = $contratosCobrado; $contratosCobrado->setComisionCobrada($this); } return $this; } public function removeContratosCobrado(Contrato $contratosCobrado): self { if ($this->contratosCobrados->removeElement($contratosCobrado)) { // set the owning side to null (unless already changed) if ($contratosCobrado->getComisionCobrada() === $this) { $contratosCobrado->setComisionCobrada(null); } } return $this; } /** * @return Collection|Contrato[] */ public function getContratosPagados(): Collection { return $this->contratosPagados; } public function addContratosPagado(Contrato $contratosPagado): self { if (!$this->contratosPagados->contains($contratosPagado)) { $this->contratosPagados[] = $contratosPagado; $contratosPagado->setComisionPagada($this); } return $this; } public function removeContratosPagado(Contrato $contratosPagado): self { if ($this->contratosPagados->removeElement($contratosPagado)) { // set the owning side to null (unless already changed) if ($contratosPagado->getComisionPagada() === $this) { $contratosPagado->setComisionPagada(null); } } return $this; } public function __toString(): string { return $this->nombre; }}