Voici votre URL de partage https://sharemycode.io/c/cffb9d6 (Cliquer pour copier) (Copié)

<?php

namespace App\Entity;

use App\Repository\CountriesRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;

#[ORM\Entity(repositoryClass: CountriesRepository::class)]
class Countries
{
    #[ORM\Id]
    #[ORM\GeneratedValue]
    #[ORM\Column]
    private ?int $id = null;

    #[ORM\OneToMany(mappedBy: 'countries', targetEntity: Users::class)]
    private Collection $user;

    #[ORM\Column]
    private ?int $code = null;

    #[ORM\Column(length: 2)]
    private ?string $alpha2 = null;

    #[ORM\Column(length: 3)]
    private ?string $alpha3 = null;

    #[ORM\Column(length: 100)]
    private ?string $nom_en_gb = null;

    #[ORM\Column(length: 100)]
    private ?string $nom_fr_fr = null;

    public function __construct()
    {
        $this->user = new ArrayCollection();
    }

    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * @return Collection<int, Users>
     */
    public function getUser(): Collection
    {
        return $this->user;
    }

    public function addUser(Users $user): self
    {
        if (!$this->user->contains($user)) {
            $this->user->add($user);
            $user->setCountries($this);
        }

        return $this;
    }

    public function removeUser(Users $user): self
    {
        if ($this->user->removeElement($user)) {
            // set the owning side to null (unless already changed)
            if ($user->getCountries() === $this) {
                $user->setCountries(null);
            }
        }

        return $this;
    }

    public function getCode(): ?int
    {
        return $this->code;
    }

    public function setCode(int $code): self
    {
        $this->code = $code;

        return $this;
    }

    public function getAlpha2(): ?string
    {
        return $this->alpha2;
    }

    public function setAlpha2(string $alpha2): self
    {
        $this->alpha2 = $alpha2;

        return $this;
    }

    public function getAlpha3(): ?string
    {
        return $this->alpha3;
    }

    public function setAlpha3(string $alpha3): self
    {
        $this->alpha3 = $alpha3;

        return $this;
    }

    public function getNomEnGb(): ?string
    {
        return $this->nom_en_gb;
    }

    public function setNomEnGb(string $nom_en_gb): self
    {
        $this->nom_en_gb = $nom_en_gb;

        return $this;
    }

    public function getNomFrFr(): ?string
    {
        return $this->nom_fr_fr;
    }

    public function setNomFrFr(string $nom_fr_fr): self
    {
        $this->nom_fr_fr = $nom_fr_fr;

        return $this;
    }
}

Informations

Cet extrait a été créé le 4 sept. 2024 à 12:20:12

Cet extrait expire le 4 oct. 2024 à 12:20:12

Langage : php

Logo php

Link

Voici votre URL de partage : https://sharemycode.io/c/cffb9d6 Copié