<?php
namespace App\Entity\Utilisateur;
use App\Entity\Clients\Client;
use App\Entity\Fournisseurs\Fournisseur;
use App\Entity\Notes\Note;
use App\Entity\Transporteurs\Transporteur;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
use App\Annotations\SecuredEntity;
/**
* Contact
*
* @ORM\Table("utilisateur__contact")
* @ORM\Entity(repositoryClass="App\Repository\Utilisateur\ContactRepository")
* @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
* @SecuredEntity (name="Contact", group="UTILISATEUR")
*/
class Contact
{
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Notes\Note", mappedBy="contact")
*/
private $notes;
/**
* @ORM\Column(name="id_import", type="string",length=255, nullable=true)
*/
private $idImport;
/**
* @ORM\Column(name="id_import_2", type="string",length=255, nullable=true)
*/
private $idImport2;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="contacts")
* @ORM\JoinColumn(nullable=true)
*/
private $utilisateur;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Service")
* @ORM\JoinColumn(nullable=true)
*/
private $serviceObj;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Civilite")
* @ORM\JoinColumn(nullable=true)
*/
private $civilite;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Fournisseurs\Fournisseur", inversedBy="contacts")
* @ORM\JoinColumn(nullable=true)
*/
private $fournisseur;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Transporteurs\Transporteur", inversedBy="contacts")
* @ORM\JoinColumn(nullable=true)
*/
private $transporteur;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Clients\Client", inversedBy="contacts")
* @ORM\JoinColumn(nullable=true)
*/
private $client;
/**
* @ORM\Column(name="service", type="string", length=255, nullable=true)
*
*/
private $service;
/**
* @ORM\Column(name="fonction", type="string", length=255, nullable=true)
*
*/
private $fonction;
/**
* @ORM\Column(name="nom", type="string", length=255, nullable=true)
*
*/
private $nom;
/**
* @ORM\Column(name="prenom", type="string", length=255, nullable=true)
* @Assert\NotBlank(message="Prenom obligatoire")
*/
private $prenom;
/**
* @ORM\Column(name="statut", type="boolean", nullable=true)
*/
private $defaut;
/**
* @ORM\Column(name="email", type="string", length=255, nullable=true)
* @Assert\Email(
* message = "Adresse email non valide"
* )
*/
private $email;
/**
* @ORM\Column(name="date", type="datetime", nullable=true)
*/
private $date;
/**
* @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
*/
private $dateSuppression;
/**
* @ORM\Column(name="dateMaj", type="datetime", nullable=true)
* @Gedmo\Timestampable(on="update")
*/
private $dateMaj;
/**
* @ORM\Column(name="telephone", type="string", length=255, nullable=true)
*/
private $telephone;
/**
* @ORM\Column(name="telephone2", type="string", length=255, nullable=true)
*/
private $telephone2;
/**
* @ORM\Column(name="fax", type="string", length=255, nullable=true)
*/
private $fax;
/**
* @ORM\Column(name="commentaire", type="text", nullable=true)
*/
private $commentaire;
/**
* @var boolean
* @ORM\Column(name="facturation_expedition_defaut", type="boolean", nullable=true)
*/
protected $facturationExpeditionDefaut;
public function __construct()
{
$this->date = new Datetime();
$this->notes = new ArrayCollection();
}
public function __toString()
{
return $this->prenom." ".$this->nom;
}
public function getId(): int
{
return $this->id;
}
public function setNom(?string $nom): Contact
{
$this->nom = $nom;
return $this;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setPrenom(?string $prenom): Contact
{
$this->prenom = $prenom;
return $this;
}
public function getPrenom(): ?string
{
return $this->prenom;
}
public function setEmail(?string $email): Contact
{
$this->email = $email;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setDate(?DateTime $date): Contact
{
$this->date = $date;
return $this;
}
public function getDate(): ?DateTime
{
return $this->date;
}
public function setDateSuppression(?DateTime $dateSuppression): Contact
{
$this->dateSuppression = $dateSuppression;
return $this;
}
public function getDateSuppression(): ?DateTime
{
return $this->dateSuppression;
}
public function setDateMaj(?DateTime $dateMaj): Contact
{
$this->dateMaj = $dateMaj;
return $this;
}
public function getDateMaj(): ?DateTime
{
return $this->dateMaj;
}
public function setTelephone(?string $telephone): Contact
{
$this->telephone = $telephone;
return $this;
}
public function getTelephone(): ?string
{
return $this->telephone;
}
public function setTelephone2(?string $telephone2): Contact
{
$this->telephone2 = $telephone2;
return $this;
}
public function getTelephone2(): ?string
{
return $this->telephone2;
}
public function setFax(?string $fax): Contact
{
$this->fax = $fax;
return $this;
}
public function getFax(): ?string
{
return $this->fax;
}
public function setUtilisateur(?Utilisateur $utilisateur): Contact
{
$this->utilisateur = $utilisateur;
return $this;
}
public function getUtilisateur(): ?Utilisateur
{
return $this->utilisateur;
}
public function setClient(?Client $client): Contact
{
$this->client = $client;
return $this;
}
public function getClient(): ?Client
{
return $this->client;
}
public function setTransporteur(?Transporteur $transporteur): Contact
{
$this->transporteur = $transporteur;
return $this;
}
public function getTransporteur(): ?Transporteur
{
return $this->transporteur;
}
public function setFournisseur(?Fournisseur $fournisseur): Contact
{
$this->fournisseur = $fournisseur;
return $this;
}
public function getFournisseur(): ?Fournisseur
{
return $this->fournisseur;
}
public function setCommentaire(?string $commentaire): Contact
{
$this->commentaire = $commentaire;
return $this;
}
public function getCommentaire(): ?string
{
return $this->commentaire;
}
public function setDefaut(?bool $defaut): Contact
{
$this->defaut = $defaut;
return $this;
}
public function getDefaut(): ?bool
{
return $this->defaut;
}
public function addNote(Note $note): Contact
{
$this->notes[] = $note;
return $this;
}
public function removeNote(Note $note)
{
$this->notes->removeElement($note);
}
public function getNotes(): Collection
{
return $this->notes;
}
public function setIdImport(?string $idImport): Contact
{
$this->idImport = $idImport;
return $this;
}
public function getIdImport(): ?string
{
return $this->idImport;
}
public function setService(?string $service): Contact
{
$this->service = $service;
return $this;
}
public function getService(): ?string
{
return $this->service;
}
public function setServiceObj(?Service $serviceObj): Contact
{
$this->serviceObj = $serviceObj;
return $this;
}
public function getServiceObj(): ?Service
{
return $this->serviceObj;
}
public function setCivilite(?Civilite $civilite): Contact
{
$this->civilite = $civilite;
return $this;
}
public function getCivilite(): ?Civilite
{
return $this->civilite;
}
public function setFacturationExpeditionDefaut(?bool $facturationExpeditionDefaut): Contact
{
$this->facturationExpeditionDefaut = $facturationExpeditionDefaut;
return $this;
}
public function getFacturationExpeditionDefaut(): ?bool
{
return $this->facturationExpeditionDefaut;
}
public function setFonction(?string $fonction): Contact
{
$this->fonction = $fonction;
return $this;
}
public function getFonction(): ?string
{
return $this->fonction;
}
public function setIdImport2(?string $idImport2): Client
{
$this->idImport2 = $idImport2;
return $this;
}
public function getIdImport2(): ?string
{
return $this->idImport2;
}
public function isDefaut(): ?bool
{
return $this->defaut;
}
public function isFacturationExpeditionDefaut(): ?bool
{
return $this->facturationExpeditionDefaut;
}
}