← Back
Editing: Prestataire.php
<?php namespace App\Entity; use App\Solution\Annotation\SolutionAware; use App\Solution\SolutionTrait; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Annotation\Groups; /** * Prestataire. * * @SolutionAware(solutionFieldName="solution_id") */ #[ORM\Table(name: 'tr_prestataire')] #[ORM\Entity(repositoryClass: 'App\Repository\PrestataireRepository')] class Prestataire { use SolutionTrait; #[ORM\Column(name: 'id', type: 'integer', nullable: false)] #[ORM\Id] #[ORM\GeneratedValue(strategy: 'IDENTITY')] #[Groups(['session', 'supervisor_presta', 'supervisor_base', 'organization_base'])] protected ?int $id = null; #[ORM\Column(name: 'nom', type: 'string', length: 255, nullable: false)] #[Groups(['supervisor_presta', 'supervisor_base', 'organization_base'])] private string $nom; #[ORM\Column(name: 'short_desc', type: 'string', length: 255, nullable: true)] private ?string $shortDesc = null; #[ORM\ManyToMany(targetEntity: Adresse::class, mappedBy: 'prestataires')] private Collection $adresses; #[ORM\OneToMany(mappedBy: 'prestataire', targetEntity: AgencyPrestataire::class, cascade: ['persist'])] private Collection $agencyPrestataires; #[ORM\Column(type: 'text', nullable: true)] private ?string $address = null; #[ORM\Column(type: 'string', length: 15, nullable: true)] private ?string $zip = null; #[ORM\Column(type: 'string', length: 255, nullable: true)] private ?string $city = null; public function __construct() { $this->adresses = new ArrayCollection(); $this->agencyPrestataires = new ArrayCollection(); } public function __toString(): string { return $this->getNom(); } public function getId(): ?int { return $this->id; } public function setId($id): self { $this->id = $id; return $this; } public function getNom(): ?string { return $this->nom; } public function setNom(string $nom): self { $this->nom = $nom; return $this; } public function getShortDesc(): ?string { return $this->shortDesc; } public function setShortDesc(?string $shortDesc): self { $this->shortDesc = $shortDesc; return $this; } public function getAdresses(): ?Collection { return $this->adresses; } public function addAdress(Adresse $adress): self { if (!$this->adresses->contains($adress)) { $this->adresses[] = $adress; $adress->addPrestataire($this); } return $this; } public function removeAdress(Adresse $adress): self { if ($this->adresses->contains($adress)) { $this->adresses->removeElement($adress); $adress->removePrestataire($this); } return $this; } /** * @return Collection<array-key, AgencyPrestataire> */ public function getAgencyPrestataires(): Collection { return $this->agencyPrestataires; } public function addAgencyPrestataire(AgencyPrestataire $agencyPrestataire): self { if (!$this->agencyPrestataires->contains($agencyPrestataire)) { $this->agencyPrestataires[] = $agencyPrestataire; $agencyPrestataire->setPrestataire($this); } return $this; } public function removeAgencyPrestataire(AgencyPrestataire $agencyPrestataire): self { if ($this->agencyPrestataires->contains($agencyPrestataire)) { $this->agencyPrestataires->removeElement($agencyPrestataire); // set the owning side to null (unless already changed) if ($agencyPrestataire->getPrestataire() === $this) { $agencyPrestataire->setPrestataire(null); } } return $this; } public function getAddress(): ?string { return $this->address; } /** * @return $this */ public function setAddress(?string $address): self { $this->address = $address; return $this; } public function getZip(): ?string { return $this->zip; } public function setZip(?string $zip): self { $this->zip = $zip; return $this; } public function getCity(): ?string { return $this->city; } public function setCity(?string $city): self { $this->city = $city; return $this; } }
Save File
Cancel