src/Entity/ParCiudadesCorrespondencia.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ParCiudadesCorrespondenciaRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassParCiudadesCorrespondenciaRepository::class)]
  8. class ParCiudadesCorrespondencia
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length100)]
  15.     private ?string $nombre null;
  16.     #[ORM\ManyToOne(inversedBy'cuidadesCorrespondencia')]
  17.     private ?ParEstado $estado null;
  18.     #[ORM\OneToMany(mappedBy'parCiudadesCorrespondencia'targetEntityRFEnvioCorrespondencia::class)]
  19.     private Collection $ciudadesCorrespondencia;
  20.     public function __construct()
  21.     {
  22.         $this->ciudadesCorrespondencia = new ArrayCollection();
  23.     }
  24.     public function getId(): ?int
  25.     {
  26.         return $this->id;
  27.     }
  28.     public function getNombre(): ?string
  29.     {
  30.         return $this->nombre;
  31.     }
  32.     public function setNombre(string $nombre): static
  33.     {
  34.         $this->nombre $nombre;
  35.         return $this;
  36.     }
  37.     public function getEstado(): ?ParEstado
  38.     {
  39.         return $this->estado;
  40.     }
  41.     public function setEstado(?ParEstado $estado): static
  42.     {
  43.         $this->estado $estado;
  44.         return $this;
  45.     }
  46.     /**
  47.      * @return Collection<int, RFEnvioCorrespondencia>
  48.      */
  49.     public function getCiudadesCorrespondencia(): Collection
  50.     {
  51.         return $this->ciudadesCorrespondencia;
  52.     }
  53.     public function addCiudadesCorrespondencium(RFEnvioCorrespondencia $ciudadesCorrespondencium): static
  54.     {
  55.         if (!$this->ciudadesCorrespondencia->contains($ciudadesCorrespondencium)) {
  56.             $this->ciudadesCorrespondencia->add($ciudadesCorrespondencium);
  57.             $ciudadesCorrespondencium->setParCiudadesCorrespondencia($this);
  58.         }
  59.         return $this;
  60.     }
  61.     public function removeCiudadesCorrespondencium(RFEnvioCorrespondencia $ciudadesCorrespondencium): static
  62.     {
  63.         if ($this->ciudadesCorrespondencia->removeElement($ciudadesCorrespondencium)) {
  64.             // set the owning side to null (unless already changed)
  65.             if ($ciudadesCorrespondencium->getParCiudadesCorrespondencia() === $this) {
  66.                 $ciudadesCorrespondencium->setParCiudadesCorrespondencia(null);
  67.             }
  68.         }
  69.         return $this;
  70.     }
  71. }