src/Entity/Vetoadom/Client.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Vetoadom;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\Validator\Constraints as Assert;
  5. /**
  6.  * Client
  7.  *
  8.  * @ORM\Table(name="client", indexes={@ORM\Index(name="FK_client_referant", columns={"referant_id"}), @ORM\Index(name="FK_client_ville", columns={"ville_id"}), @ORM\Index(name="FK_client_habitation", columns={"habitation_id"})})
  9.  * @ORM\Entity(repositoryClass="App\Repository\Vetoadom\ClientRepository")
  10.  * @ORM\HasLifecycleCallbacks()
  11.  */
  12. class Client
  13. {
  14.     /**
  15.      * @var int
  16.      *
  17.      * @ORM\Column(name="id", type="integer", nullable=false)
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue(strategy="IDENTITY")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @var string
  24.      *
  25.      * @ORM\Column(name="nom", type="string", length=190, nullable=false)
  26.      * @Assert\NotBlank(
  27.      *       groups={"nom"},
  28.      *       message="common.blank"
  29.      *    )
  30.      * @Assert\Length(
  31.      *       groups={"nom"},
  32.      *       max=190,
  33.      *       maxMessage="common.too_long"
  34.      *    )
  35.      */
  36.     private $nom;
  37.     /**
  38.      * @var string|null
  39.      *
  40.      * @ORM\Column(name="email", type="string", length=75, nullable=true)
  41.      * @Assert\Email(
  42.      *       groups={"email"},
  43.      *       message="common.email"
  44.      *    )
  45.      */
  46.     private $email;
  47.     /**
  48.      * @var string
  49.      *
  50.      * @ORM\Column(name="telephone1", type="string", length=30, nullable=false)
  51.      * @Assert\NotBlank(
  52.      *           groups={"telephone1"},
  53.      *           message="common.blank"
  54.      *        )
  55.      * @Assert\Regex(
  56.      *          groups={"telephone1"},
  57.      *          pattern="/^\d{1,30}$/",
  58.      *          message="common.format_wrong"
  59.      *       )
  60.      */
  61.     private $telephone1;
  62.     /**
  63.      * @var string|null
  64.      *
  65.      * @ORM\Column(name="telephone2", type="string", length=30, nullable=true)
  66.      * @Assert\Regex(
  67.      *           groups={"telephone2"},
  68.      *           pattern="/^\d{1,30}$/",
  69.      *           message="common.format_wrong"
  70.      *        )
  71.      */
  72.     private $telephone2;
  73.     /**
  74.      * @var string|null
  75.      *
  76.      * @ORM\Column(name="adresse", type="string", length=38, nullable=true)
  77.      * @Assert\NotBlank(
  78.      *       groups={"adresse"},
  79.      *       message="common.blank"
  80.      *    )
  81.      * @Assert\Length(
  82.      *       groups={"adresse"},
  83.      *       max=38,
  84.      *       maxMessage="common.too_long"
  85.      *    )
  86.      */
  87.     private $adresse;
  88.     /**
  89.      * @var string|null
  90.      *
  91.      * @ORM\Column(name="complement_adresse", type="string", length=38, nullable=true)
  92.      * @Assert\Length(
  93.      *       groups={"complementAdresse"},
  94.      *       max=38,
  95.      *       maxMessage="common.too_long"
  96.      *    )
  97.      */
  98.     private $complementAdresse;
  99.     /**
  100.      * @var string|null
  101.      *
  102.      * @ORM\Column(name="interphone", type="string", length=20, nullable=true)
  103.      * @Assert\Length(
  104.      *        groups={"interphone"},
  105.      *        max=20,
  106.      *        maxMessage="common.too_long"
  107.      *     )
  108.      */
  109.     private $interphone;
  110.     /**
  111.      * @var string|null
  112.      *
  113.      * @ORM\Column(name="code", type="string", length=20, nullable=true)
  114.      * @Assert\Length(
  115.      *         groups={"code"},
  116.      *         max=20,
  117.      *         maxMessage="common.too_long"
  118.      *      )
  119.      */
  120.     private $code;
  121.     /**
  122.      * @var string|null
  123.      *
  124.      * @ORM\Column(name="batiment", type="string", length=20, nullable=true)
  125.      * @Assert\Length(
  126.      *          groups={"batiment"},
  127.      *          max=20,
  128.      *          maxMessage="common.too_long"
  129.      *       )
  130.      */
  131.     private $batiment;
  132.     /**
  133.      * @var string|null
  134.      *
  135.      * @ORM\Column(name="ascenseur", type="string", length=20, nullable=true)
  136.      * @Assert\Length(
  137.      *           groups={"ascenseur"},
  138.      *           max=20,
  139.      *           maxMessage="common.too_long"
  140.      *        )
  141.      */
  142.     private $ascenseur;
  143.     /**
  144.      * @var string|null
  145.      *
  146.      * @ORM\Column(name="escalier", type="string", length=20, nullable=true)
  147.      * @Assert\Length(
  148.      *           groups={"escalier"},
  149.      *           max=20,
  150.      *           maxMessage="common.too_long"
  151.      *        )
  152.      */
  153.     private $escalier;
  154.     /**
  155.      * @var string|null
  156.      *
  157.      * @ORM\Column(name="etage", type="string", length=20, nullable=true)
  158.      * @Assert\Length(
  159.      *           groups={"etage"},
  160.      *           max=20,
  161.      *           maxMessage="common.too_long"
  162.      *        )
  163.      */
  164.     private $etage;
  165.     /**
  166.      * @var string|null
  167.      *
  168.      * @ORM\Column(name="appartement", type="string", length=20, nullable=true)
  169.      * @Assert\Length(
  170.      *           groups={"appartement"},
  171.      *           max=20,
  172.      *           maxMessage="common.too_long"
  173.      *        )
  174.      */
  175.     private $appartement;
  176.     /**
  177.      * @var string|null
  178.      *
  179.      * @ORM\Column(name="informations_complementaires", type="text", length=65535, nullable=true)
  180.      * @Assert\Length(
  181.      *           groups={"informationsComplementaires"},
  182.      *           max=65535,
  183.      *           maxMessage="common.too_long"
  184.      *        )
  185.      */
  186.     private $informationsComplementaires;
  187.     /**
  188.      * @var string|null
  189.      *
  190.      * @ORM\Column(name="informations_particulier", type="text", length=65535, nullable=true)
  191.      * @Assert\Length(
  192.      *           groups={"informationsParticulier"},
  193.      *           max=65535,
  194.      *           maxMessage="common.too_long"
  195.      *        )
  196.      */
  197.     private $informationsParticulier;
  198.     /**
  199.      * @var \DateTime|null
  200.      *
  201.      * @ORM\Column(name="info_part_date_modification", type="datetime", nullable=true)
  202.      */
  203.     private $infoPartDateModification;
  204.     /**
  205.      * @var \DateTime
  206.      *
  207.      * @ORM\Column(name="date_creation", type="datetime", nullable=false)
  208.      */
  209.     private $dateCreation;
  210.     /**
  211.      * @var \DateTime
  212.      *
  213.      * @ORM\Column(name="date_modification", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"})
  214.      */
  215.     private $dateModification;
  216.     /**
  217.      * @var \DateTime|null
  218.      *
  219.      * @ORM\Column(name="date_suppression", type="datetime", nullable=true)
  220.      */
  221.     private $dateSuppression;
  222.     /**
  223.      * @var bool
  224.      *
  225.      * @ORM\Column(name="active", type="boolean", nullable=false, options={"default"="1"})
  226.      */
  227.     private $active true;
  228.     /**
  229.      * @var \Habitation
  230.      *
  231.      * @ORM\ManyToOne(targetEntity="Habitation")
  232.      * @ORM\JoinColumns({
  233.      *   @ORM\JoinColumn(name="habitation_id", referencedColumnName="id")
  234.      * })
  235.      * @Assert\NotBlank(
  236.      *       groups={"habitation"},
  237.      *       message="common.blank"
  238.      *    )
  239.      */
  240.     private $habitation;
  241.     /**
  242.      * @var \Referant
  243.      *
  244.      * @ORM\ManyToOne(targetEntity="Referant")
  245.      * @ORM\JoinColumns({
  246.      *   @ORM\JoinColumn(name="referant_id", referencedColumnName="id")
  247.      * })
  248.      * @Assert\NotBlank(
  249.      *        groups={"referant"},
  250.      *        message="common.blank"
  251.      *     )
  252.      */
  253.     private $referant;
  254.     /**
  255.      * @var \Ville
  256.      *
  257.      * @ORM\ManyToOne(targetEntity="Ville")
  258.      * @ORM\JoinColumns({
  259.      *   @ORM\JoinColumn(name="ville_id", referencedColumnName="id")
  260.      * })
  261.      * @Assert\NotBlank(
  262.      *         groups={"ville"},
  263.      *         message="common.blank"
  264.      *      )
  265.      */
  266.     private $ville;
  267.     public function getId(): ?int
  268.     {
  269.         return $this->id;
  270.     }
  271.     public function getNom(): ?string
  272.     {
  273.         return $this->nom;
  274.     }
  275.     public function setNom(string $nom): self
  276.     {
  277.         $this->nom $nom;
  278.         return $this;
  279.     }
  280.     public function getEmail(): ?string
  281.     {
  282.         return $this->email;
  283.     }
  284.     public function setEmail(?string $email): self
  285.     {
  286.         if ($email === ''$email null;
  287.         $this->email $email;
  288.         return $this;
  289.     }
  290.     public function getTelephone1(): ?string
  291.     {
  292.         return $this->telephone1;
  293.     }
  294.     public function setTelephone1(string $telephone1): self
  295.     {
  296.         $this->telephone1 $telephone1;
  297.         return $this;
  298.     }
  299.     public function getTelephone2(): ?string
  300.     {
  301.         return $this->telephone2;
  302.     }
  303.     public function setTelephone2(?string $telephone2): self
  304.     {
  305.         if ($telephone2 === ''$telephone2 null;
  306.         $this->telephone2 $telephone2;
  307.         return $this;
  308.     }
  309.     public function getAdresse(): ?string
  310.     {
  311.         return $this->adresse;
  312.     }
  313.     public function setAdresse(?string $adresse): self
  314.     {
  315.         if ($adresse === ''$adresse null;
  316.         $this->adresse $adresse;
  317.         return $this;
  318.     }
  319.     public function getComplementAdresse(): ?string
  320.     {
  321.         return $this->complementAdresse;
  322.     }
  323.     public function setComplementAdresse(?string $complementAdresse): self
  324.     {
  325.         if ($complementAdresse === ''$complementAdresse null;
  326.         $this->complementAdresse $complementAdresse;
  327.         return $this;
  328.     }
  329.     public function getInterphone(): ?string
  330.     {
  331.         return $this->interphone;
  332.     }
  333.     public function setInterphone(?string $interphone): self
  334.     {
  335.         if ($interphone === ''$interphone null;
  336.         $this->interphone $interphone;
  337.         return $this;
  338.     }
  339.     public function getCode(): ?string
  340.     {
  341.         return $this->code;
  342.     }
  343.     public function setCode(?string $code): self
  344.     {
  345.         if ($code === ''$code null;
  346.         $this->code $code;
  347.         return $this;
  348.     }
  349.     public function getBatiment(): ?string
  350.     {
  351.         return $this->batiment;
  352.     }
  353.     public function setBatiment(?string $batiment): self
  354.     {
  355.         if ($batiment === ''$batiment null;
  356.         $this->batiment $batiment;
  357.         return $this;
  358.     }
  359.     public function getAscenseur(): ?string
  360.     {
  361.         return $this->ascenseur;
  362.     }
  363.     public function setAscenseur(?string $ascenseur): self
  364.     {
  365.         if ($ascenseur === ''$ascenseur null;
  366.         $this->ascenseur $ascenseur;
  367.         return $this;
  368.     }
  369.     public function getEscalier(): ?string
  370.     {
  371.         return $this->escalier;
  372.     }
  373.     public function setEscalier(?string $escalier): self
  374.     {
  375.         if ($escalier === ''$escalier null;
  376.         $this->escalier $escalier;
  377.         return $this;
  378.     }
  379.     public function getEtage(): ?string
  380.     {
  381.         return $this->etage;
  382.     }
  383.     public function setEtage(?string $etage): self
  384.     {
  385.         if ($etage === ''$etage null;
  386.         $this->etage $etage;
  387.         return $this;
  388.     }
  389.     public function getAppartement(): ?string
  390.     {
  391.         return $this->appartement;
  392.     }
  393.     public function setAppartement(?string $appartement): self
  394.     {
  395.         if ($appartement === ''$appartement null;
  396.         $this->appartement $appartement;
  397.         return $this;
  398.     }
  399.     public function getInformationsComplementaires(): ?string
  400.     {
  401.         return $this->informationsComplementaires;
  402.     }
  403.     public function setInformationsComplementaires(?string $informationsComplementaires): self
  404.     {
  405.         if ($informationsComplementaires === ''$informationsComplementaires null;
  406.         $this->informationsComplementaires $informationsComplementaires;
  407.         return $this;
  408.     }
  409.     public function getInformationsParticulier(): ?string
  410.     {
  411.         return $this->informationsParticulier;
  412.     }
  413.     public function setInformationsParticulier(?string $informationsParticulier): self
  414.     {
  415.         $oldValue $this->informationsParticulier;
  416.         if ($informationsParticulier === ''$informationsParticulier null;
  417.         $this->informationsParticulier $informationsParticulier;
  418.         if ($oldValue !== $this->informationsParticulier) {
  419.             $this->setInfoPartDateModification(new \DateTime());
  420.         }
  421.         return $this;
  422.     }
  423.     public function getInfoPartDateModification(): ?\DateTimeInterface
  424.     {
  425.         return $this->infoPartDateModification;
  426.     }
  427.     public function setInfoPartDateModification(?\DateTimeInterface $infoPartDateModification): self
  428.     {
  429.         $this->infoPartDateModification $infoPartDateModification;
  430.         return $this;
  431.     }
  432.     public function getDateCreation(): ?\DateTimeInterface
  433.     {
  434.         return $this->dateCreation;
  435.     }
  436.     public function setDateCreation(\DateTimeInterface $dateCreation): self
  437.     {
  438.         $this->dateCreation $dateCreation;
  439.         return $this;
  440.     }
  441.     public function getDateModification(): ?\DateTimeInterface
  442.     {
  443.         return $this->dateModification;
  444.     }
  445.     public function setDateModification(\DateTimeInterface $dateModification): self
  446.     {
  447.         $this->dateModification $dateModification;
  448.         return $this;
  449.     }
  450.     public function getDateSuppression(): ?\DateTimeInterface
  451.     {
  452.         return $this->dateSuppression;
  453.     }
  454.     public function setDateSuppression(?\DateTimeInterface $dateSuppression): self
  455.     {
  456.         $this->dateSuppression $dateSuppression;
  457.         return $this;
  458.     }
  459.     public function getActive(): ?bool
  460.     {
  461.         return $this->active;
  462.     }
  463.     public function setActive(bool $active): self
  464.     {
  465.         $this->active $active;
  466.         return $this;
  467.     }
  468.     public function getHabitation(): ?Habitation
  469.     {
  470.         return $this->habitation;
  471.     }
  472.     public function setHabitation(?Habitation $habitation): self
  473.     {
  474.         $this->habitation $habitation;
  475.         return $this;
  476.     }
  477.     public function getReferant(): ?Referant
  478.     {
  479.         return $this->referant;
  480.     }
  481.     public function setReferant(?Referant $referant): self
  482.     {
  483.         $this->referant $referant;
  484.         return $this;
  485.     }
  486.     public function getVille(): ?Ville
  487.     {
  488.         return $this->ville;
  489.     }
  490.     public function setVille(?Ville $ville): self
  491.     {
  492.         $this->ville $ville;
  493.         return $this;
  494.     }
  495.     /**
  496.      * @ORM\PrePersist
  497.      */
  498.     public function setCreatedAtValue()
  499.     {
  500.         $this->dateCreation = new \DateTimeImmutable();
  501.     }
  502. }