src/Entity/Utilisateur/Contact.php line 24

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Utilisateur;
  3. use App\Entity\Clients\Client;
  4. use App\Entity\Fournisseurs\Fournisseur;
  5. use App\Entity\Notes\Note;
  6. use App\Entity\Transporteurs\Transporteur;
  7. use DateTime;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use Doctrine\Common\Collections\Collection;
  10. use Doctrine\ORM\Mapping as ORM;
  11. use Gedmo\Mapping\Annotation as Gedmo;
  12. use Symfony\Component\Validator\Constraints as Assert;
  13. use App\Annotations\SecuredEntity;
  14. /**
  15.  * Contact
  16.  *
  17.  * @ORM\Table("utilisateur__contact")
  18.  * @ORM\Entity(repositoryClass="App\Repository\Utilisateur\ContactRepository")
  19.  * @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
  20.  * @SecuredEntity (name="Contact", group="UTILISATEUR")
  21.  */
  22. class Contact
  23. {
  24.     /**
  25.      * @ORM\Column(name="id", type="integer")
  26.      * @ORM\Id
  27.      * @ORM\GeneratedValue(strategy="AUTO")
  28.      */
  29.     private $id;
  30.     /**
  31.      * @ORM\OneToMany(targetEntity="App\Entity\Notes\Note", mappedBy="contact")
  32.      */
  33.     private $notes;
  34.     /**
  35.      * @ORM\Column(name="id_import", type="string",length=255, nullable=true)
  36.      */
  37.     private $idImport;
  38.     /**
  39.      * @ORM\Column(name="id_import_2", type="string",length=255, nullable=true)
  40.      */
  41.     private $idImport2;
  42.     /**
  43.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="contacts")
  44.      * @ORM\JoinColumn(nullable=true)
  45.      */
  46.     private $utilisateur;
  47.     /**
  48.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Service")
  49.      * @ORM\JoinColumn(nullable=true)
  50.      */
  51.     private $serviceObj;
  52.     /**
  53.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Civilite")
  54.      * @ORM\JoinColumn(nullable=true)
  55.      */
  56.     private $civilite;
  57.     /**
  58.      * @ORM\ManyToOne(targetEntity="App\Entity\Fournisseurs\Fournisseur", inversedBy="contacts")
  59.      * @ORM\JoinColumn(nullable=true)
  60.      */
  61.     private $fournisseur;
  62.     /**
  63.      * @ORM\ManyToOne(targetEntity="App\Entity\Transporteurs\Transporteur", inversedBy="contacts")
  64.      * @ORM\JoinColumn(nullable=true)
  65.      */
  66.     private $transporteur;
  67.     /**
  68.      * @ORM\ManyToOne(targetEntity="App\Entity\Clients\Client", inversedBy="contacts")
  69.      * @ORM\JoinColumn(nullable=true)
  70.      */
  71.     private $client;
  72.     /**
  73.      * @ORM\Column(name="service", type="string", length=255, nullable=true)
  74.      *
  75.      */
  76.     private $service;
  77.     /**
  78.      * @ORM\Column(name="fonction", type="string", length=255, nullable=true)
  79.      *
  80.      */
  81.     private $fonction;
  82.     /**
  83.      * @ORM\Column(name="nom", type="string", length=255, nullable=true)
  84.      *
  85.      */
  86.     private $nom;
  87.     /**
  88.      * @ORM\Column(name="prenom", type="string", length=255, nullable=true)
  89.      * @Assert\NotBlank(message="Prenom obligatoire")
  90.      */
  91.     private $prenom;
  92.     /**
  93.      * @ORM\Column(name="statut", type="boolean", nullable=true)
  94.      */
  95.     private $defaut;
  96.     /**
  97.      * @ORM\Column(name="email", type="string", length=255, nullable=true)
  98.      * @Assert\Email(
  99.      *     message = "Adresse email non valide"
  100.      * )
  101.      */
  102.     private $email;
  103.     /**
  104.      * @ORM\Column(name="date", type="datetime", nullable=true)
  105.      */
  106.     private $date;
  107.     /**
  108.      * @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
  109.      */
  110.     private $dateSuppression;
  111.     /**
  112.      * @ORM\Column(name="dateMaj", type="datetime", nullable=true)
  113.      * @Gedmo\Timestampable(on="update")
  114.      */
  115.     private $dateMaj;
  116.     /**
  117.      * @ORM\Column(name="telephone", type="string", length=255, nullable=true)
  118.      */
  119.     private $telephone;
  120.     /**
  121.      * @ORM\Column(name="telephone2", type="string", length=255, nullable=true)
  122.      */
  123.     private $telephone2;
  124.     /**
  125.      * @ORM\Column(name="fax", type="string", length=255, nullable=true)
  126.      */
  127.     private $fax;
  128.     /**
  129.      * @ORM\Column(name="commentaire", type="text", nullable=true)
  130.      */
  131.     private $commentaire;
  132.     /**
  133.      * @var boolean
  134.      * @ORM\Column(name="facturation_expedition_defaut", type="boolean", nullable=true)
  135.      */
  136.     protected $facturationExpeditionDefaut;
  137.     public function __construct()
  138.     {
  139.         $this->date     = new Datetime();
  140.         $this->notes    = new ArrayCollection();
  141.     }
  142.     public function __toString()
  143.     {
  144.         return $this->prenom." ".$this->nom;
  145.     }
  146.     public function getId(): int
  147.     {
  148.         return $this->id;
  149.     }
  150.     public function setNom(?string $nom): Contact
  151.     {
  152.         $this->nom $nom;
  153.         return $this;
  154.     }
  155.     public function getNom(): ?string
  156.     {
  157.         return $this->nom;
  158.     }
  159.     public function setPrenom(?string $prenom): Contact
  160.     {
  161.         $this->prenom $prenom;
  162.         return $this;
  163.     }
  164.     public function getPrenom(): ?string
  165.     {
  166.         return $this->prenom;
  167.     }
  168.     public function setEmail(?string $email): Contact
  169.     {
  170.         $this->email $email;
  171.         return $this;
  172.     }
  173.     public function getEmail(): ?string
  174.     {
  175.         return $this->email;
  176.     }
  177.     public function setDate(?DateTime $date): Contact
  178.     {
  179.         $this->date $date;
  180.         return $this;
  181.     }
  182.     public function getDate(): ?DateTime
  183.     {
  184.         return $this->date;
  185.     }
  186.     public function setDateSuppression(?DateTime $dateSuppression): Contact
  187.     {
  188.         $this->dateSuppression $dateSuppression;
  189.         return $this;
  190.     }
  191.     public function getDateSuppression(): ?DateTime
  192.     {
  193.         return $this->dateSuppression;
  194.     }
  195.     public function setDateMaj(?DateTime $dateMaj): Contact
  196.     {
  197.         $this->dateMaj $dateMaj;
  198.         return $this;
  199.     }
  200.     public function getDateMaj(): ?DateTime
  201.     {
  202.         return $this->dateMaj;
  203.     }
  204.     public function setTelephone(?string $telephone): Contact
  205.     {
  206.         $this->telephone $telephone;
  207.         return $this;
  208.     }
  209.     public function getTelephone(): ?string
  210.     {
  211.         return $this->telephone;
  212.     }
  213.     public function setTelephone2(?string $telephone2): Contact
  214.     {
  215.         $this->telephone2 $telephone2;
  216.         return $this;
  217.     }
  218.     public function getTelephone2(): ?string
  219.     {
  220.         return $this->telephone2;
  221.     }
  222.     public function setFax(?string $fax): Contact
  223.     {
  224.         $this->fax $fax;
  225.         return $this;
  226.     }
  227.     public function getFax(): ?string
  228.     {
  229.         return $this->fax;
  230.     }
  231.     public function setUtilisateur(?Utilisateur $utilisateur): Contact
  232.     {
  233.         $this->utilisateur $utilisateur;
  234.         return $this;
  235.     }
  236.     public function getUtilisateur(): ?Utilisateur
  237.     {
  238.         return $this->utilisateur;
  239.     }
  240.     public function setClient(?Client $client): Contact
  241.     {
  242.         $this->client $client;
  243.         return $this;
  244.     }
  245.     public function getClient(): ?Client
  246.     {
  247.         return $this->client;
  248.     }
  249.     public function setTransporteur(?Transporteur $transporteur): Contact
  250.     {
  251.         $this->transporteur $transporteur;
  252.         return $this;
  253.     }
  254.     public function getTransporteur(): ?Transporteur
  255.     {
  256.         return $this->transporteur;
  257.     }
  258.     public function setFournisseur(?Fournisseur $fournisseur): Contact
  259.     {
  260.         $this->fournisseur $fournisseur;
  261.         return $this;
  262.     }
  263.     public function getFournisseur(): ?Fournisseur
  264.     {
  265.         return $this->fournisseur;
  266.     }
  267.     public function setCommentaire(?string $commentaire): Contact
  268.     {
  269.         $this->commentaire $commentaire;
  270.         return $this;
  271.     }
  272.     public function getCommentaire(): ?string
  273.     {
  274.         return $this->commentaire;
  275.     }
  276.     public function setDefaut(?bool $defaut): Contact
  277.     {
  278.         $this->defaut $defaut;
  279.         return $this;
  280.     }
  281.     public function getDefaut(): ?bool
  282.     {
  283.         return $this->defaut;
  284.     }
  285.     public function addNote(Note $note): Contact
  286.     {
  287.         $this->notes[] = $note;
  288.         return $this;
  289.     }
  290.     public function removeNote(Note $note)
  291.     {
  292.         $this->notes->removeElement($note);
  293.     }
  294.     public function getNotes(): Collection
  295.     {
  296.         return $this->notes;
  297.     }
  298.     public function setIdImport(?string $idImport): Contact
  299.     {
  300.         $this->idImport $idImport;
  301.         return $this;
  302.     }
  303.     public function getIdImport(): ?string
  304.     {
  305.         return $this->idImport;
  306.     }
  307.     public function setService(?string $service): Contact
  308.     {
  309.         $this->service $service;
  310.         return $this;
  311.     }
  312.     public function getService(): ?string
  313.     {
  314.         return $this->service;
  315.     }
  316.     public function setServiceObj(?Service $serviceObj): Contact
  317.     {
  318.         $this->serviceObj $serviceObj;
  319.         return $this;
  320.     }
  321.     public function getServiceObj(): ?Service
  322.     {
  323.         return $this->serviceObj;
  324.     }
  325.     public function setCivilite(?Civilite $civilite): Contact
  326.     {
  327.         $this->civilite $civilite;
  328.         return $this;
  329.     }
  330.     public function getCivilite(): ?Civilite
  331.     {
  332.         return $this->civilite;
  333.     }
  334.     public function setFacturationExpeditionDefaut(?bool $facturationExpeditionDefaut): Contact
  335.     {
  336.         $this->facturationExpeditionDefaut $facturationExpeditionDefaut;
  337.         return $this;
  338.     }
  339.     public function getFacturationExpeditionDefaut(): ?bool
  340.     {
  341.         return $this->facturationExpeditionDefaut;
  342.     }
  343.     public function setFonction(?string $fonction): Contact
  344.     {
  345.         $this->fonction $fonction;
  346.         return $this;
  347.     }
  348.     public function getFonction(): ?string
  349.     {
  350.         return $this->fonction;
  351.     }
  352.     public function setIdImport2(?string $idImport2): Client
  353.     {
  354.         $this->idImport2 $idImport2;
  355.         return $this;
  356.     }
  357.     public function getIdImport2(): ?string
  358.     {
  359.         return $this->idImport2;
  360.     }
  361.     public function isDefaut(): ?bool
  362.     {
  363.         return $this->defaut;
  364.     }
  365.     public function isFacturationExpeditionDefaut(): ?bool
  366.     {
  367.         return $this->facturationExpeditionDefaut;
  368.     }
  369. }