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

Nom du fichier : Entité Company

<?php

namespace App\Entity;

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

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

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

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

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

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

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

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

    #[ORM\Column(nullable: true)]
    private ?int $department = null;

    #[ORM\Column(length: 255, nullable: true)]
    private ?string $groupName = null;

    #[ORM\ManyToMany(targetEntity: Derogation::class, mappedBy: 'client')]
    private Collection $derogationForClient;

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

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

    public function getName(): ?string
    {
        return $this->name;
    }

    public function setName(string $name): self
    {
        $this->name = $name;

        return $this;
    }

    public function getCity(): ?string
    {
        return $this->city;
    }

    public function setCity(string $city): self
    {
        $this->city = $city;

        return $this;
    }

    public function getCountry(): ?string
    {
        return $this->country;
    }

    public function setCountry(string $country): self
    {
        $this->country = $country;

        return $this;
    }

    public function getErpId(): ?string
    {
        return $this->erpId;
    }

    public function setErpId(string $erpId): self
    {
        $this->erpId = $erpId;

        return $this;
    }

    public function getCdpId(): ?int
    {
        return $this->cdpId;
    }

    public function setCdpId(int $cdpId): self
    {
        $this->cdpId = $cdpId;

        return $this;
    }

    public function getIdSoc(): ?string
    {
        return $this->id_soc;
    }

    public function setIdSoc(string $id_soc): self
    {
        $this->id_soc = $id_soc;

        return $this;
    }

    public function getDepartment(): ?int
    {
        return $this->department;
    }

    public function setDepartment(?int $department): self
    {
        $this->department = $department;

        return $this;
    }

    public function getGroupName(): ?string
    {
        return $this->groupName;
    }

    public function setGroupName(?string $groupName): self
    {
        $this->groupName = $groupName;

        return $this;
    }

    /**
     * @return Collection<int, Derogation>
     */
    public function getDerogationForClient(): Collection
    {
        return $this->derogationForClient;
    }

    public function addDerogationForClient(Derogation $derogationForClient): self
    {
        if (!$this->derogationForClient->contains($derogationForClient)) {
            $this->derogationForClient->add($derogationForClient);
            $derogationForClient->addClient($this);
        }

        return $this;
    }

    public function removeDerogationForClient(Derogation $derogationForClient): self
    {
        if ($this->derogationForClient->removeElement($derogationForClient)) {
            $derogationForClient->removeClient($this);
        }
        return $this;
    }
}

Informations

Cet extrait a été créé le 25 mai 2023 à 13:56:27

Cet extrait expire le 24 juin 2023 à 13:56:27

Langage : php

Logo php

Link

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

Demander la suppression