<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\Validator\Constraints as Assert;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Entity(repositoryClass="App\Repository\PrivateUserRepository")
*
* @Vich\Uploadable
*/
class PrivateUser extends User
{
/**
* @Vich\UploadableField(mapping="user_cni_recto", fileNameProperty="CNIRecto")
*
* @Assert\NotBlank(groups={"portugal", "belgium"})
*
* @Assert\File(
* maxSize = "8M",
* groups={"portugal", "belgium"},
* maxSizeMessage = "Ce fichier est trop volumineux (maximum à {{ limit }}Mo)"
* )
*
* @var File
*/
protected $CNIRectoFile;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*
* @var string
*/
protected $CNIRecto;
/**
* @Vich\UploadableField(mapping="user_cni_verso", fileNameProperty="CNIVerso")
*
* @Assert\NotBlank(groups={"portugal", "belgium"})
*
* @Assert\File(
* maxSize = "8M",
* groups={"portugal", "belgium"},
* maxSizeMessage = "Ce fichier est trop volumineux (maximum à {{ limit }}Mo)"
* )
*
* @var File
*/
protected $CNIVersoFile;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*
* @var string
*/
protected $CNIVerso;
/**
* @Vich\UploadableField(mapping="user_domiciliation", fileNameProperty="domiciliation")
*
* @Assert\NotBlank(groups={"portugal", "belgium"})
*
* @Assert\File(
* maxSize = "8M",
* groups={"portugal", "belgium"},
* maxSizeMessage = "Ce fichier est trop volumineux (maximum à {{ limit }}Mo)"
* )
*
* @var File
*/
protected $domiciliationFile;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*
* @var string
*/
protected $domiciliation;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*
* @Assert\NotBlank(groups={"portugal"})
*
* @Assert\Length(
* groups={"portugal"},
* max = 9
* )
*
* @var string
*/
protected $NIFNumber;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $customerId;
public function __construct()
{
parent::__construct();
$this->needsTransaction = true;
}
public function getSalesforceType()
{
if (true === $this->society) {
return parent::SF_TYPE_SOCIETY;
}
return parent::SF_TYPE_PERSON;
}
/**
* Get the value of CNIRecto.
*
* @return string
*/
public function getCNIRecto()
{
return $this->CNIRecto;
}
/**
* Set the value of CNIRecto.
*
* @return self
*/
public function setCNIRecto(?string $CNIRecto)
{
$this->CNIRecto = $CNIRecto;
return $this;
}
/**
* Get ).
*
* @return File
*/
public function getCNIRectoFile()
{
return $this->CNIRectoFile;
}
/**
* @return self
*/
public function setCNIRectoFile(?File $CNIRectoFile)
{
$this->CNIRectoFile = $CNIRectoFile;
if (null !== $CNIRectoFile) {
// It is required that at least one field changes if you are using doctrine
// otherwise the event listeners won't be called and the file is lost
$this->updatedAt = new \DateTimeImmutable();
}
return $this;
}
/**
* Get the value of CNIVerso.
*
* @return string
*/
public function getCNIVerso()
{
return $this->CNIVerso;
}
/**
* Set the value of CNIVerso.
*
* @return self
*/
public function setCNIVerso(?string $CNIVerso)
{
$this->CNIVerso = $CNIVerso;
return $this;
}
/**
* Get the value of domiciliation.
*
* @return string
*/
public function getDomiciliation()
{
return $this->domiciliation;
}
/**
* Set the value of domiciliation.
*
* @return self
*/
public function setDomiciliation(?string $domiciliation)
{
$this->domiciliation = $domiciliation;
return $this;
}
/**
* Get the value of NIFNumber.
*
* @return string
*/
public function getNIFNumber()
{
return $this->NIFNumber;
}
/**
* Set the value of NIFNumber.
*
* @return self
*/
public function setNIFNumber(?string $NIFNumber)
{
$this->NIFNumber = $NIFNumber;
return $this;
}
/**
* @return string
*/
public function getCustomerId()
{
return $this->customerId;
}
/**
* @return $this
*/
public function setCustomerId(?string $customerId)
{
$this->customerId = $customerId;
return $this;
}
/**
* Get ).
*
* @return File
*/
public function getCNIVersoFile()
{
return $this->CNIVersoFile;
}
/**
* Get ).
*
* @return File
*/
public function getDomiciliationFile()
{
return $this->domiciliationFile;
}
public function setCNIVersoFile(?File $CNIVersoFile)
{
$this->CNIVersoFile = $CNIVersoFile;
if (null !== $CNIVersoFile) {
// It is required that at least one field changes if you are using doctrine
// otherwise the event listeners won't be called and the file is lost
$this->updatedAt = new \DateTimeImmutable();
}
return $this;
}
public function setDomiciliationFile(?File $domiciliationFile)
{
$this->domiciliationFile = $domiciliationFile;
if (null !== $domiciliationFile) {
// It is required that at least one field changes if you are using doctrine
// otherwise the event listeners won't be called and the file is lost
$this->updatedAt = new \DateTimeImmutable();
}
return $this;
}
}