<?php
namespace App\Entity;
use App\Repository\SupplierRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use App\Form\EmailType;
/**
* @ORM\Entity(repositoryClass=SupplierRepository::class)
*/
class Supplier {
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=180, nullable=true)
*/
private $name;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $civility;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $nameResponsable ;
/**
* @ORM\Column(type="string", length=180, nullable=true)
* @Assert\Email(
* message = "L'adresse email '{{ value }}' n'est pas valide."
* )
*/
private $email;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $phone;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $second_phone;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $adress;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $second_adress;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $country;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $region;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $city;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $tariff_category;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $zip;
/**
* @ORM\OneToMany(targetEntity=Link::class, mappedBy="supplier")
*/
private $links;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\OneToMany(targetEntity=Document::class, mappedBy="supplier")
*/
private $documents;
/**
* @ORM\OneToMany(targetEntity=Address::class, mappedBy="supplier")
*/
private $multiAddress;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $type;
/**
* @ORM\Column(type="boolean", options={"default": true})
*/
private bool $isActive = true;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $raisonSociale;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $identifiantFiscal;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $iban;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $bankName;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $website;
/**
* @ORM\Column(type="string", length=20, nullable=true)
*/
private $phoneResponsible1;
/**
* @ORM\Column(type="string", length=20, nullable=true)
*/
private $phoneResponsible2;
/**
* @ORM\OneToMany(targetEntity=user::class, mappedBy="supplier")
*/
private $contacts;
/**
* @ORM\OneToMany(targetEntity=Comment::class, mappedBy="supplier", cascade={"persist", "remove"})
*/
private $comments;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $logo = null;
public function __construct()
{
$this->links = new ArrayCollection();
$this->documents = new ArrayCollection();
$this->multiAddress = new ArrayCollection();
$this->contacts = new ArrayCollection();
$this->comments = new ArrayCollection();
}
public function getId(): ?int {
return $this->id;
}
public function getName(): ?string {
return $this->name;
}
public function setName(string $name): self {
$this->name = $name;
return $this;
}
public function getCivility(): ?string {
return $this->civility;
}
public function setCivility(string $civility): self {
$this->civility = $civility;
return $this;
}
public function getNameResponsable(): ?string {
return $this->nameResponsable;
}
public function setNameResponsable (string $nameResponsable): self {
$this->nameResponsable = $nameResponsable;
return $this;
}
public function getEmail(): ?string {
return $this->email;
}
public function setEmail(string $email): self {
$this->email = $email;
return $this;
}
public function getDescription(): ?string {
return $this->description;
}
public function setDescription(string $description): self {
$this->description = $description;
return $this;
}
public function getPhone(): ?string {
return $this->phone;
}
public function setPhone(string $phone): self {
$this->phone = $phone;
return $this;
}
public function getSecondPhone(): ?string {
return $this->second_phone;
}
public function setSecondPhone(?string $second_phone): self {
$this->second_phone = $second_phone;
return $this;
}
public function getAdress(): ?string {
return $this->adress;
}
public function setAdress(string $adress): self {
$this->adress = $adress;
return $this;
}
public function getSecondAdress(): ?string {
return $this->second_adress;
}
public function setSecondAdress(?string $second_adress): self {
$this->second_adress = $second_adress;
return $this;
}
public function getCountry(): ?string {
return $this->country;
}
public function setCountry(string $country): self {
$this->country = $country;
return $this;
}
public function getRegion(): ?string {
return $this->region;
}
public function setRegion(string $region): self {
$this->region = $region;
return $this;
}
public function getCity(): ?string {
return $this->city;
}
public function setCity(string $city): self {
$this->city = $city;
return $this;
}
public function getTariffCategory(): ?string {
return $this->tariff_category;
}
public function setTariffCategory(?string $tariff_category): self {
$this->tariff_category = $tariff_category;
return $this;
}
public function getZip(): ?string {
return $this->zip;
}
public function setZip(string $zip): self {
$this->zip = $zip;
return $this;
}
public function getLogo(): ?string
{
return $this->logo;
}
public function setLogo(?string $logo): self
{
$this->logo = $logo; return $this;
}
/**
* @return Collection|Link[]
*/
public function getLinks(): Collection
{
return $this->links;
}
public function addLink(Link $link): self
{
if( !$this->links->contains($link)) {
$this->links[] = $link;
$link->setSupplier($this);
}
return $this;
}
public function removeLink(Link $link): self
{
if( $this->links->removeElement($link)) {
// set the owning side to null (unless already changed)
if( $link->getSupplier() === $this) {
$link->setSupplier(null);
}
}
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function isActive(): bool
{
return $this->isActive;
}
public function setIsActive(bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
/**
* @return Collection|Document[]
*/
public function getDocuments(): Collection
{
return $this->documents;
}
public function addDocument(Document $document): self
{
if( !$this->documents->contains($document)) {
$this->documents[] = $document;
$document->setSupplier($this);
}
return $this;
}
public function removeDocument(Document $document): self
{
if( $this->documents->removeElement($document)) {
// set the owning side to null (unless already changed)
if( $document->getSupplier() === $this) {
$document->setSupplier(null);
}
}
return $this;
}
/**
* @return Collection|Address[]
*/
public function getMultiAddress(): Collection
{
return $this->multiAddress;
}
public function addMultiAddress(Address $multiAddress): self
{
if( !$this->multiAddress->contains($multiAddress)) {
$this->multiAddress[] = $multiAddress;
$multiAddress->setSupplier($this);
}
return $this;
}
public function removeMultiAddress(Address $multiAddress): self
{
if( $this->multiAddress->removeElement($multiAddress)) {
// set the owning side to null (unless already changed)
if( $multiAddress->getSupplier() === $this) {
$multiAddress->setSupplier(null);
}
}
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(?string $type): self
{
$this->type = $type;
return $this;
}
/**
* @return Collection|user[]
*/
public function getContacts(): Collection
{
return $this->contacts;
}
public function addContact(user $contact): self
{
if( !$this->contacts->contains($contact)) {
$this->contacts[] = $contact;
$contact->setSupplier($this);
}
return $this;
}
public function removeContact(user $contact): self
{
if( $this->contacts->removeElement($contact)) {
// set the owning side to null (unless already changed)
if( $contact->getSupplier() === $this) {
$contact->setSupplier(null);
}
}
return $this;
}
public function getRaisonSociale(): ?string
{
return $this->raisonSociale;
}
public function setRaisonSociale(?string $raisonSociale): self
{
$this->raisonSociale = $raisonSociale;
return $this;
}
public function getIdentifiantFiscal(): ?string
{
return $this->identifiantFiscal;
}
public function setIdentifiantFiscal(?string $identifiantFiscal): self
{
$this->identifiantFiscal = $identifiantFiscal;
return $this;
}
public function getIban(): ?string
{
return $this->iban;
}
public function setIban(?string $iban): self
{
$this->iban = $iban;
return $this;
}
public function getBankName(): ?string
{
return $this->bankName;
}
public function setBankName(?string $bankName): self
{
$this->bankName = $bankName;
return $this;
}
public function getWebsite(): ?string
{
return $this->website;
}
public function setWebsite(?string $website): self
{
$this->website = $website;
return $this;
}
public function getPhoneResponsible1(): ?string
{
return $this->phoneResponsible1;
}
public function setPhoneResponsible1(?string $phoneResponsible1): self
{
$this->phoneResponsible1 = $phoneResponsible1;
return $this;
}
public function getPhoneResponsible2(): ?string
{
return $this->phoneResponsible2;
}
public function setPhoneResponsible2(?string $phoneResponsible2): self
{
$this->phoneResponsible2 = $phoneResponsible2;
return $this;
}
/**
* @return Collection|Comment[]
*/
public function getComments(): Collection
{
return $this->comments;
}
public function addComment(Comment $comment): self
{
if( !$this->comments->contains($comment)) {
$this->comments[] = $comment;
$comment->setSupplier($this);
}
return $this;
}
public function removeComment(Comment $comment): self
{
if( $this->comments->removeElement($comment)) {
// set the owning side to null (unless already changed)
if( $comment->getSupplier() === $this) {
$comment->setSupplier(null);
}
}
return $this;
}
}