src/Entity/Contact.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ContactRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassContactRepository::class)]
  9. class Contact
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255)]
  16.     private ?string $denomination null;
  17.     #[ORM\Column(length9)]
  18.     private ?string $siren null;
  19.     #[ORM\Column(length255)]
  20.     private ?string $nom null;
  21.     #[ORM\Column(length255)]
  22.     private ?string $tel1 null;
  23.     #[ORM\Column(length255)]
  24.     private ?string $email null;
  25.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  26.     private ?\DateTimeInterface $date_creation null;
  27.     #[ORM\OneToMany(mappedBy'contact'targetEntityProject::class, cascade: ['remove'])]
  28.     private Collection $projects;
  29.     #[ORM\OneToMany(mappedBy'contact'targetEntityDossier::class, cascade: ['remove'])]
  30.     private Collection $dossiers;
  31.     #[ORM\ManyToOne(inversedBy'contacts')]
  32.     private ?ContactType $contact_type null;
  33.     #[ORM\OneToMany(mappedBy'contact'targetEntityVariableValue::class, cascade: ['remove'])]
  34.     private Collection $variableValues;
  35.     #[ORM\ManyToOne(inversedBy'associatedContacts')]
  36.     #[ORM\JoinColumn(name"parent_contact_id"referencedColumnName"id"nullabletrue)]
  37.     private ?Contact $parentContact;
  38.     #[ORM\OneToMany(mappedBy'parentContact'targetEntityContact::class, cascade: ['remove'])]
  39.     private Collection $associatedContacts;
  40.     #[ORM\Column(length255nullabletrue)]
  41.     private ?string $compte_client null;
  42.     #[ORM\Column(length255nullabletrue)]
  43.     private ?string $tel2 null;
  44.     #[ORM\Column(length255nullabletrue)]
  45.     private ?string $adresse null;
  46.     #[ORM\Column(length255nullabletrue)]
  47.     private ?string $siret null;
  48.     #[ORM\Column(nullabletrue)]
  49.     private ?bool $emailing null;
  50.     #[ORM\Column(nullabletrue)]
  51.     private ?bool $antispam null;
  52.     #[ORM\ManyToOne(inversedBy'contacts')]
  53.     private ?User $utilisateur null;
  54.     #[ORM\OneToMany(mappedBy'contact'targetEntityFichier::class)]
  55.     private Collection $fichiers;
  56.     public function __construct()
  57.     {
  58.         $this->projects = new ArrayCollection();
  59.         $this->dossiers = new ArrayCollection();
  60.         $this->variableValues = new ArrayCollection();
  61.         $this->associatedContacts = new ArrayCollection();
  62.         $this->fichiers = new ArrayCollection();
  63.     }
  64.     public function getId(): ?int
  65.     {
  66.         return $this->id;
  67.     }
  68.     public function getDenomination(): ?string
  69.     {
  70.         return $this->denomination;
  71.     }
  72.     public function setDenomination(string $denomination): static
  73.     {
  74.         $this->denomination $denomination;
  75.         return $this;
  76.     }
  77.     public function getSiren(): ?string
  78.     {
  79.         return $this->siren;
  80.     }
  81.     public function setSiren(string $siren): static
  82.     {
  83.         $this->siren $siren;
  84.         return $this;
  85.     }
  86.     public function getNom(): ?string
  87.     {
  88.         return $this->nom;
  89.     }
  90.     public function setNom(string $nom): static
  91.     {
  92.         $this->nom $nom;
  93.         return $this;
  94.     }
  95.     public function getTel1(): ?string
  96.     {
  97.         return $this->tel1;
  98.     }
  99.     public function setTel1(string $tel1): static
  100.     {
  101.         $this->tel1 $tel1;
  102.         return $this;
  103.     }
  104.     public function getEmail(): ?string
  105.     {
  106.         return $this->email;
  107.     }
  108.     public function setEmail(string $email): static
  109.     {
  110.         $this->email $email;
  111.         return $this;
  112.     }
  113.     public function getDateCreation(): ?\DateTimeInterface
  114.     {
  115.         return $this->date_creation;
  116.     }
  117.     public function setDateCreation(\DateTimeInterface $date_creation): static
  118.     {
  119.         $this->date_creation $date_creation;
  120.         return $this;
  121.     }
  122.     /**
  123.      * @return Collection<int, Project>
  124.      */
  125.     public function getProjects(): Collection
  126.     {
  127.         return $this->projects;
  128.     }
  129.     public function addProject(Project $project): static
  130.     {
  131.         if (!$this->projects->contains($project)) {
  132.             $this->projects->add($project);
  133.             $project->setContact($this);
  134.         }
  135.         return $this;
  136.     }
  137.     public function removeProject(Project $project): static
  138.     {
  139.         if ($this->projects->removeElement($project)) {
  140.             // set the owning side to null (unless already changed)
  141.             if ($project->getContact() === $this) {
  142.                 $project->setContact(null);
  143.             }
  144.         }
  145.         return $this;
  146.     }
  147.     /**
  148.      * @return Collection<int, Dossier>
  149.      */
  150.     public function getDossiers(): Collection
  151.     {
  152.         return $this->dossiers;
  153.     }
  154.     public function addDossier(Dossier $dossier): static
  155.     {
  156.         if (!$this->dossiers->contains($dossier)) {
  157.             $this->dossiers->add($dossier);
  158.             $dossier->setContact($this);
  159.         }
  160.         return $this;
  161.     }
  162.     public function removeDossier(Dossier $dossier): static
  163.     {
  164.         if ($this->dossiers->removeElement($dossier)) {
  165.             // set the owning side to null (unless already changed)
  166.             if ($dossier->getContact() === $this) {
  167.                 $dossier->setContact(null);
  168.             }
  169.         }
  170.         return $this;
  171.     }
  172.     
  173.     public function getContactType(): ?ContactType
  174.     {
  175.         return $this->contact_type;
  176.     }
  177.     public function setContactType(?ContactType $contact_type): static
  178.     {
  179.         $this->contact_type $contact_type;
  180.         return $this;
  181.     }
  182.     /**
  183.      * @return Collection<int, VariableValue>
  184.      */
  185.     public function getVariableValues(): Collection
  186.     {
  187.         return $this->variableValues;
  188.     }
  189.     public function addVariableValue(VariableValue $variableValue): static
  190.     {
  191.         if (!$this->variableValues->contains($variableValue)) {
  192.             $this->variableValues->add($variableValue);
  193.             $variableValue->setContact($this);
  194.         }
  195.         return $this;
  196.     }
  197.     public function removeVariableValue(VariableValue $variableValue): static
  198.     {
  199.         if ($this->variableValues->removeElement($variableValue)) {
  200.             // set the owning side to null (unless already changed)
  201.             if ($variableValue->getContact() === $this) {
  202.                 $variableValue->setContact(null);
  203.             }
  204.         }
  205.         return $this;
  206.     }
  207.     public function getParentContact(): ?Contact
  208.     {
  209.         return $this->parentContact;
  210.     }
  211.     public function setParentContact(?Contact $parentContact): static
  212.     {
  213.         $this->parentContact $parentContact;
  214.         return $this;
  215.     }
  216.     /**
  217.      * @return Collection<int, Contact>
  218.      */
  219.     public function getAssociatedContacts(): Collection
  220.     {
  221.         return $this->associatedContacts;
  222.     }
  223.     public function addAssociatedContact(Contact $associatedContact): static
  224.     {
  225.         if (!$this->associatedContacts->contains($associatedContact)) {
  226.             $this->associatedContacts->add($associatedContact);
  227.             $associatedContact->setParentContact($this);
  228.         }
  229.         return $this;
  230.     }
  231.     public function removeAssociatedContact(Contact $associatedContact): static
  232.     {
  233.         if ($this->associatedContacts->removeElement($associatedContact)) {
  234.             $associatedContact->setParentContact(null);
  235.         }
  236.         return $this;
  237.     }
  238.     public function getCompteClient(): ?string
  239.     {
  240.         return $this->compte_client;
  241.     }
  242.     public function setCompteClient(?string $compte_client): static
  243.     {
  244.         $this->compte_client $compte_client;
  245.         return $this;
  246.     }
  247.     public function getTel2(): ?string
  248.     {
  249.         return $this->tel2;
  250.     }
  251.     public function setTel2(?string $tel2): static
  252.     {
  253.         $this->tel2 $tel2;
  254.         return $this;
  255.     }
  256.     public function getAdresse(): ?string
  257.     {
  258.         return $this->adresse;
  259.     }
  260.     public function setAdresse(?string $adresse): static
  261.     {
  262.         $this->adresse $adresse;
  263.         return $this;
  264.     }
  265.     public function getSiret(): ?string
  266.     {
  267.         return $this->siret;
  268.     }
  269.     public function setSiret(?string $siret): static
  270.     {
  271.         $this->siret $siret;
  272.         return $this;
  273.     }
  274.     public function isEmailing(): ?bool
  275.     {
  276.         return $this->emailing;
  277.     }
  278.     public function setEmailing(?bool $emailing): static
  279.     {
  280.         $this->emailing $emailing;
  281.         return $this;
  282.     }
  283.     public function isAntispam(): ?bool
  284.     {
  285.         return $this->antispam;
  286.     }
  287.     public function setAntispam(?bool $antispam): static
  288.     {
  289.         $this->antispam $antispam;
  290.         return $this;
  291.     }
  292.     public function getUtilisateur(): ?User
  293.     {
  294.         return $this->utilisateur;
  295.     }
  296.     public function setUtilisateur(?User $utilisateur): static
  297.     {
  298.         $this->utilisateur $utilisateur;
  299.         return $this;
  300.     }
  301.     /**
  302.      * @return Collection<int, Fichier>
  303.      */
  304.     public function getFichiers(): Collection
  305.     {
  306.         return $this->fichiers;
  307.     }
  308.     public function addFichier(Fichier $fichier): static
  309.     {
  310.         if (!$this->fichiers->contains($fichier)) {
  311.             $this->fichiers->add($fichier);
  312.             $fichier->setContact($this);
  313.         }
  314.         return $this;
  315.     }
  316.     public function removeFichier(Fichier $fichier): static
  317.     {
  318.         if ($this->fichiers->removeElement($fichier)) {
  319.             // set the owning side to null (unless already changed)
  320.             if ($fichier->getContact() === $this) {
  321.                 $fichier->setContact(null);
  322.             }
  323.         }
  324.         return $this;
  325.     }
  326.     public function __toString() {
  327.         return (string) $this->id;  // Ou une autre propriété qui représente bien l'objet
  328.     }
  329. }