<?php
namespace App\Entity\System;
use App\Factory\ControlPanel\Wishlist\WishListFactory;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\PersistentCollection;
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
use Symfony\Component\Security\Core\User\UserInterface;
/**
* Customer
*
* @ORM\Table(name="ps_customer")
*
* @ORM\Entity(repositoryClass="App\Repository\System\CustomerRepository")
*/
class Customer implements UserInterface, PasswordAuthenticatedUserInterface
{
public const DEFAULT_SYS_USER_ID = 1523;
public const IDS_USERS_SYS = [self::DEFAULT_SYS_USER_ID, 131588, 131590, 245190];
public const PARTIAL_CREATION_STEP_0 = 2;
public const PARTIAL_CREATION = 1;
public const ACCOUNT_COMPLETE = 0;
public const WITHOUT_PACK_GROUP = 1;
public const WHOLESALE_GROUP = 2;
public const EMPLOYEE_GROUP = 3;
public const ID_CUSTOMER_NOT_BILLING_AGREEMENT = '0';
public const WORKHUMAN_CUSTOMER_IDS = [232487, 235957, 235968, 235969, 235972, 235973, 235974, 235976, 235977, 235978, 235980, 235986, 235989, 235993, 235994, 235996, 277077, 425892, 425896, 454066, 454504, 454508, 454511, 454513, 454515, 635273, 669050];
public const WORKHUMAN_PRICE_FACTOR = 1.01;
public const PROFIT_GROUPS_WHOLESALER = [self::WHOLESALE_GROUP, self::EMPLOYEE_GROUP];
public const NINE_CUSTOMER_ID = 132688;
public const CUSTOMER_DISABLE_CONTROL_FLAG = '_baja';
public const SESSION_ACCOUNT_SUCCESS = 'ACCOUNT_SUCCESS';
/**
* @ORM\Id()
*
* @ORM\GeneratedValue()
*
* @ORM\Column(type="integer", name="id_customer")
*/
private $id;
/**
* @var Group|null
*
* @ORM\ManyToOne(targetEntity="App\Entity\System\Group", inversedBy="customers")
*
* @ORM\JoinColumn(name="id_group", referencedColumnName="id_group",referencedColumnName="id_group")
*/
private $group;
/**
* @var Language|null
*
* @ORM\ManyToOne(targetEntity="App\Entity\System\Language")
*
* @ORM\JoinColumn(name="id_lang", referencedColumnName="id_lang",referencedColumnName="id_lang")
*/
private $language;
/**
* @var string|null
*
* @ORM\Column(type="string", length=14, nullable=true)
*/
private $prefixe;
/**
* @var string|null
*
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $name;
/**
* @var string|null
*
* @ORM\Column(type="string", length=32, nullable=true)
*/
private $surnames;
/**
* @var string
*
* @ORM\Column(type="string", length=128)
*/
private $email;
/**
* @var string
*
* @ORM\Column(type="string", length=100)
*/
private $passwd;
/**
* @var string|null
*
* @ORM\Column(type="string", length=32, nullable=true)
*/
private $taxNumber;
/**
* @var int|null
*
* @ORM\Column(type="integer", length=11, nullable=true)
*/
private $idPack;
/**
* @var float
*
* @ORM\Column(type="decimal", precision=10, scale=2)
*/
private $purse;
/**
* @var \DateTime
*
* @ORM\Column(type="datetime", options={"default" : "CURRENT_TIMESTAMP"})
*/
private $lastPasswdGen;
/**
* @var \DateTime|null
*
* @ORM\Column(type="date", nullable=true)
*/
private $birthday;
/**
* @var bool
*
* @ORM\Column(type="boolean", columnDefinition="tinyint(1)", options={"default" : 0})
*/
private $newsletter;
/**
* @var string|null
*
* @ORM\Column(type="string", length=15, nullable=true)
*/
private $ipRegistrationNewsletter;
/**
* @var \DateTime
*
* @ORM\Column(type="datetime", nullable=true)
*/
private $block;
/**
* @var bool
*
* @ORM\Column(type="boolean", columnDefinition="tinyint(1)", options={"default" : 0})
*/
private $withdrawalWarehouse;
/**
* @var bool
*
* @ORM\Column(type="boolean", columnDefinition="tinyint(1)", options={"default" : 0})
*/
private $multifactorAuthEnabled;
/**
* @var bool
*
* @ORM\Column(type="boolean", columnDefinition="tinyint(4)", options={"default" : 0})
*/
private $subscription;
/**
* @var int|null
*
* @ORM\Column(type="integer", length=10, nullable=true)
*/
private $idService;
/**
* @var bool
*
* @ORM\Column(type="boolean", columnDefinition="tinyint(1)", options={"default" : 0})
*/
private $reserve;
/**
* @var bool
*
* @ORM\Column(type="boolean", columnDefinition="tinyint(1)", options={"default" : 0})
*/
private $active;
/**
* @var bool
*
* @ORM\Column(type="boolean", columnDefinition="tinyint(1)", options={"default" : 0})
*/
private $isGuest;
/**
* @var bool
*
* @ORM\Column(type="boolean", columnDefinition="tinyint(1)", options={"default" : 0})
*/
private $isValidVat;
/**
* @var bool
*
* @ORM\Column(type="boolean", columnDefinition="tinyint(1)", options={"default" : 0})
*/
private $dropshipping;
/**
* @var \DateTime
*
* @ORM\Column(type="datetime")
*/
private $dateAdd;
/**
* @var \DateTime
*
* @ORM\Column(type="datetime")
*/
private $dateUpd;
/**
* @var string|null
*
* @ORM\Column(type="text", nullable=true)
*/
private $comment;
/**
* @var string|null
*
* @ORM\Column(type="string", length=10, nullable=true)
*/
private $commissionAgent;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $dateCsv;
/**
* @var \DateTime|null
*
* @ORM\Column(type="datetime", nullable=true)
*/
private $dateBlock;
/**
* @var string|null
*
* @ORM\Column(type="string", length=30, nullable=true, options={"default" : "0"})
*/
private $paypalBillingAgreement;
/**
* @var \DateTime|null
*
* @ORM\Column(type="datetime", nullable=true)
*/
private $datePack;
/**
* @var string|null
*
* @ORM\Column(type="string", length=2, nullable=true)
*/
private $csvLang;
/**
* @var string|null
*
* @ORM\Column(type="string", length=50, nullable=true)
*/
private $dropshippingName;
/**
* @var string|null
*
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $emailPaypal;
/**
* @var bool|null
*
* @ORM\Column(type="boolean", columnDefinition="tinyint(1)", options={"default" : 0})
*/
private $sincronizedErp;
/**
* @var bool|null
*
* @ORM\Column(type="boolean", columnDefinition="tinyint(4)", options={"default" : 0}, nullable=true)
*/
private $promotions;
/**
* @var bool|null
*
* @ORM\Column(type="boolean", columnDefinition="tinyint(1)", options={"default" : 0}, nullable=true)
*/
private $moroso;
/**
* @var bool|null
*
* @ORM\Column(type="boolean", columnDefinition="tinyint(1)", options={"default" : 0}, nullable=true)
*/
private $avatar;
/**
* @var bool|null
*
* @ORM\Column(type="boolean", columnDefinition="tinyint(1)", options={"default" : 0}, nullable=true)
*/
private $avisoContabilidad;
/**
* @var string|null
*
* @ORM\Column(type="string", length=25, nullable=true)
*/
private $payerIdPaypal;
/**
* @var bool
*
* @ORM\Column(type="boolean", columnDefinition="tinyint(1)", options={"default" : 1})
*/
private $orderCsv;
/**
* @var \DateTime|null
*
* @ORM\Column(type="datetime", nullable=true)
*/
private $dateBasicFree;
/**
* @var bool|null
*
* @ORM\Column(type="boolean", columnDefinition="tinyint(4)" ,nullable=true)
*/
private $excluirVies;
/**
* @var bool|null
*
* @ORM\Column(type="boolean", columnDefinition="tinyint(4)", options={"default" : 0}, nullable=true)
*/
private $blocked;
/**
* @var \DateTime|null
*
* @ORM\Column(type="datetime", nullable=true)
*/
private $dateExcluirIva;
/**
* @var float|null
*
* @ORM\Column(type="float", precision=10, scale=2, options={"default" : 0.00}, nullable=true)
*/
private $dtoPersonal1;
/**
* @var float|null
*
* @ORM\Column(type="float", precision=10, scale=2, options={"default" : 0.00}, nullable=true)
*/
private $dtoPersonal2;
/**
* @var float|null
*
* @ORM\Column(type="float", precision=10, scale=2, options={"default" : 0.00}, nullable=true)
*/
private $dtoPersonal3;
/**
* @var float|null
*
* @ORM\Column(type="float", precision=10, scale=2, options={"default" : 0.00}, nullable=true)
*/
private $importePersonal1;
/**
* @var float|null
*
* @ORM\Column(type="float", precision=10, scale=2, options={"default" : 0.00}, nullable=true)
*/
private $importePersonal2;
/**
* @var float|null
*
* @ORM\Column(type="float", precision=10, scale=2, options={"default" : 0.00}, nullable=true)
*/
private $importePersonal3;
/**
* @var int|null
*
* @ORM\Column(type="integer", length=11, options={"default" : 0}, nullable=true)
*/
private $creditType;
/**
* @var int|null
*
* @ORM\Column(type="integer", length=11, nullable=true)
*/
private $multichannelUserId;
/**
* @var int|null
*
* @ORM\Column(type="integer", length=11, options={"default" : 0}, nullable=true)
*/
private $controlpanelMipEnabled;
/**
* @var int|null
*
* @ORM\Column(type="integer", length=1)
*/
private $forcePasswordUpdate;
/**
* @var int|null
*
* @ORM\Column(type="integer", length=2, nullable=true)
*/
private $top;
/**
* @var string|null
*
* @ORM\Column(type="string", name="KAM", length=50, nullable=true)
*/
private $kam;
/**
* @var \DateTime|null
*
* @ORM\Column(type="datetime", nullable=true)
*/
private $readPolicyCookies;
/**
* @var string|null
*
* @ORM\Column(type="string", length=32, nullable=true)
*/
private $sector;
/**
* @var string|null
*
* @ORM\Column(type="string", length=32, nullable=true)
*/
private $catchment;
/**
* @var string|null
*
* @ORM\Column(type="string", length=64, nullable=true)
*/
private $type;
/**
* @var int|null
*
* @ORM\Column(type="integer", length=1, options={"default" : 0}, nullable=true)
*/
private $packByPurse;
/**
* @var int|null
*
* @ORM\Column(type="integer", length=1)
*/
private $partialCreation;
/**
* @var bool|null
*
* @ORM\Column(type="boolean", length=1, options={"default" : 0})
*/
private $purchaseNotAllowed;
/**
* @var \DateTime|null
*
* @ORM\Column(type="datetime", nullable=true)
*/
private $dateEnding;
/**
* @var string|null
*
* @ORM\Column(type="string", length=150, nullable=true)
*/
private $userIdPaycomet;
/**
* @var string|null
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $userTokenPaycomet;
/**
* @var int|null
*
* @ORM\Column(type="string", nullable=true)
*/
private $paycometMit;
/**
* @var bool|null
*
* @ORM\Column(type="boolean", nullable=true)
*/
private $packBankwirePayment;
/**
* @ORM\OneToMany(targetEntity="App\Entity\System\Order", mappedBy="customer")
*/
private $orders;
/**
* @ORM\OneToMany(targetEntity="App\Entity\System\Address", mappedBy="customer", cascade={"persist"})
*/
private $addresses;
/**
* @var ArrayCollection|FuturePack[]
*
* @ORM\OneToMany(targetEntity="App\Entity\System\FuturePack", mappedBy="customer")
*/
private $futurePacks;
/**
* @var ArrayCollection|SubscriptionLine[]
*
* @ORM\OneToMany(targetEntity="SubscriptionLine", mappedBy="customer")
*/
private $subscriptionLines;
/**
* @var PersistentCollection|ServiceCustomer[]
*
* @ORM\OneToMany(targetEntity="ServiceCustomer", mappedBy="customer", cascade={"persist"})
*/
private $serviceCustomer;
/**
* @ORM\OneToMany(targetEntity="CustomerApi", mappedBy="customer", cascade={"persist"})
*/
private $customerApi;
/**
* @ORM\OneToMany(targetEntity="CustomerLog", mappedBy="customer", cascade={"persist"})
*/
private $customerLog;
/**
* @ORM\OneToMany(targetEntity="App\Entity\System\Ftp", mappedBy="customer")
*/
private $ftp;
/**
* @ORM\OneToMany(targetEntity="App\Entity\System\SynchronisedShopConfiguration", mappedBy="customer")
*/
private $syncronisedShopConfiguration;
/**
* @ORM\OneToMany(targetEntity="App\Entity\System\CustomerMigration", mappedBy="customer")
*/
private $customerMigration;
/**
* @var Role[]|ArrayCollection
*
* @ORM\ManyToMany(targetEntity="App\Entity\System\Role", inversedBy="customers")
*
* @ORM\JoinTable(name="customer_role",
* joinColumns={@ORM\JoinColumn(name="id_customer", referencedColumnName="id_customer")},
* inverseJoinColumns={@ORM\JoinColumn(name="id_role", referencedColumnName="id_role")}
* )
*/
private $roles;
/**
* @ORM\OneToMany(targetEntity="App\Entity\System\CustomerCatalog", mappedBy="customer", cascade={"persist"}, indexBy="catalog_id")
*/
private $customerCatalogs;
/**
* @var AdditionalInfoAnswer[]|ArrayCollection
*
* @ORM\ManyToMany(targetEntity="App\Entity\System\AdditionalInfoAnswer", inversedBy="customers")
*
* @ORM\JoinTable(
* name="customer_additional_info_answer",
* inverseJoinColumns={@ORM\JoinColumn(name="answer_id", referencedColumnName="id")},
* joinColumns={@ORM\JoinColumn(name="customer_id", referencedColumnName="id_customer")}
* )
*/
private $additionalInfoAnswers;
/**
* @var string|null
*
* @ORM\Column(type="string", length=64, nullable=true)
*/
private $adyenPaymentId;
/**
* @var Wishlist[]|ArrayCollection
*
* @ORM\OneToMany(targetEntity="Wishlist", mappedBy="customer", cascade={"persist"})
*/
private $wishlists;
/**
* @var string
*
* @ORM\Column(type="string", length=50, nullable= true)
*/
private $thePowerMbaUserId;
/**
* @var string|null
*
* @ORM\Column(type="string", nullable=true)
*/
private $googleAccountId;
/**
* @var string|null
*
* @ORM\Column(type="string", nullable=true)
*/
private $linkedinAccountId;
/**
* Customer constructor.
*
* @throws \Exception
*/
public function __construct()
{
$this->group = 1;
$this->lastPasswdGen = new \DateTime();
$this->newsletter = 0;
$this->withdrawalWarehouse = 0;
$this->subscription = 0;
$this->reserve = 0;
$this->active = 0;
$this->isGuest = 0;
$this->isValidVat = 0;
$this->dropshipping = 0;
$this->paypalBillingAgreement = '0';
$this->sincronizedErp = 0;
$this->promotions = 0;
$this->moroso = 0;
$this->avatar = 0;
$this->avisoContabilidad = 0;
$this->orderCsv = 1;
$this->blocked = 0;
$this->dtoPersonal1 = 0.00;
$this->dtoPersonal2 = 0.00;
$this->dtoPersonal3 = 0.00;
$this->importePersonal1 = 0.00;
$this->importePersonal2 = 0.00;
$this->importePersonal3 = 0.00;
$this->creditType = 0;
$this->orders = new ArrayCollection();
$this->addresses = new ArrayCollection();
$this->futurePacks = new ArrayCollection();
$this->subscriptionLines = new ArrayCollection();
$this->serviceCustomer = new ArrayCollection();
$this->customerApi = new ArrayCollection();
$this->customerLog = new ArrayCollection();
$this->customerMigration = new ArrayCollection();
$this->syncronisedShopConfiguration = new ArrayCollection();
$this->ftp = new ArrayCollection();
$this->roles = new ArrayCollection();
$this->customerCatalogs = new ArrayCollection();
$this->additionalInfoAnswers = new ArrayCollection();
$this->wishlists = new ArrayCollection();
$this->controlpanelMipEnabled = 0;
}
public static function createEmptyCustomer(string $email, string $password, Group $group, Role $role, Language $language, \DateTime $currentDateTime, \DateTime $zeroDate): Customer
{
$customer = new self();
$customer->email = $email;
$customer->passwd = $password;
$customer->language = $language;
$customer->active = true;
$customer->purse = 0;
$customer->dateAdd = $currentDateTime;
$customer->dateUpd = $currentDateTime;
$customer->dateCsv = $zeroDate;
$customer->dateExcluirIva = $zeroDate;
$customer->orderCsv = false;
$customer->idPack = 0;
$customer->multichannelUserId = 0;
$customer->packByPurse = 0;
$customer->group = $group;
$customer->name = '';
$customer->partialCreation = self::PARTIAL_CREATION_STEP_0;
$customer->multifactorAuthEnabled = true;
$customer->roles = [$role];
$customer->wishlists = new ArrayCollection([WishListFactory::createDefault($customer, $customer->getLanguage()->getId())]);
$customer->controlpanelMipEnabled = 1;
return $customer;
}
public function getPassword(): string
{
return $this->getPasswd();
}
public function getSalt(): ?string
{
return null;
}
public function getUsername(): string
{
return $this->email;
}
public function eraseCredentials()
{
}
public function getEncoderName(): ?string
{
return 'customer_encoder';
}
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
public function getUserIdentifier(): string
{
return (string)$this->id;
}
/**
* @param mixed $id
*
* @return Customer
*/
public function setId($id): Customer
{
$this->id = $id;
return $this;
}
/**
* @return Group|null
*/
public function getGroup(): ?Group
{
return $this->group;
}
/**
* @param Group|null $group
*
* @return Customer
*/
public function setGroup(?Group $group): Customer
{
$this->group = $group;
return $this;
}
/**
* @return Language|null
*/
public function getLanguage(): ?Language
{
return $this->language;
}
/**
* @param Language|null $language
*
* @return Customer
*/
public function setLanguage(?Language $language): Customer
{
$this->language = $language;
return $this;
}
/**
* @return string|null
*/
public function getPrefixe(): ?string
{
return $this->prefixe;
}
/**
* @param string|null $prefixe
*
* @return Customer
*/
public function setPrefixe(?string $prefixe): Customer
{
$this->prefixe = $prefixe;
return $this;
}
/**
* @return string|null
*/
public function getName(): ?string
{
return $this->name;
}
/**
* @param string|null $name
*
* @return Customer
*/
public function setName(?string $name): Customer
{
$this->name = $name;
return $this;
}
/**
* @return string|null
*/
public function getSurnames(): ?string
{
return $this->surnames;
}
/**
* @param string|null $surnames
*
* @return Customer
*/
public function setSurnames(?string $surnames): Customer
{
$this->surnames = $surnames;
return $this;
}
/**
* @return string
*/
public function getEmail(): string
{
return $this->email;
}
/**
* @param string $email
*
* @return Customer
*/
public function setEmail(string $email): Customer
{
$this->email = $email;
return $this;
}
/**
* @return string
*/
public function getPasswd(): string
{
return $this->passwd;
}
/**
* @param string $passwd
*
* @return Customer
*/
public function setPasswd(string $passwd): Customer
{
$this->passwd = $passwd;
return $this;
}
/**
* @return string|null
*/
public function getTaxNumber(): ?string
{
return $this->taxNumber;
}
/**
* @param string|null $taxNumber
*
* @return Customer
*/
public function setTaxNumber(?string $taxNumber): Customer
{
$this->taxNumber = $taxNumber;
return $this;
}
/**
* @return int|null
*/
public function getIdPack(): ?int
{
return $this->idPack;
}
/**
* @param int|null $idPack
*
* @return Customer
*/
public function setIdPack(?int $idPack): Customer
{
$this->idPack = $idPack;
return $this;
}
/**
* @return float
*/
public function getPurse(): float
{
return $this->purse;
}
/**
* @param float $purse
*
* @return Customer
*/
public function setPurse(float $purse): Customer
{
$this->purse = $purse;
return $this;
}
/**
* @return \DateTime
*/
public function getLastPasswdGen(): \DateTime
{
return $this->lastPasswdGen;
}
/**
* @param \DateTime $lastPasswdGen
*
* @return Customer
*/
public function setLastPasswdGen(\DateTime $lastPasswdGen): Customer
{
$this->lastPasswdGen = $lastPasswdGen;
return $this;
}
/**
* @return \DateTime|null
*/
public function getBirthday(): ?\DateTime
{
return $this->birthday;
}
/**
* @param \DateTime|null $birthday
*
* @return Customer
*/
public function setBirthday(?\DateTime $birthday): Customer
{
$this->birthday = $birthday;
return $this;
}
/**
* @return bool
*/
public function isNewsletter(): bool
{
return $this->newsletter;
}
/**
* @param bool $newsletter
*
* @return Customer
*/
public function setNewsletter(bool $newsletter): Customer
{
$this->newsletter = $newsletter;
return $this;
}
/**
* @return string|null
*/
public function getIpRegistrationNewsletter(): ?string
{
return $this->ipRegistrationNewsletter;
}
/**
* @param string|null $ipRegistrationNewsletter
*
* @return Customer
*/
public function setIpRegistrationNewsletter(?string $ipRegistrationNewsletter): Customer
{
$this->ipRegistrationNewsletter = $ipRegistrationNewsletter;
return $this;
}
/**
* @return \DateTime
*/
public function getBlock(): \DateTime
{
return $this->block;
}
/**
* @param \DateTime $block
*
* @return Customer
*/
public function setBlock(\DateTime $block): Customer
{
$this->block = $block;
return $this;
}
/**
* @return bool
*/
public function isWithdrawalWarehouse(): bool
{
return $this->withdrawalWarehouse;
}
/**
* @param bool $withdrawalWarehouse
*
* @return Customer
*/
public function setWithdrawalWarehouse(bool $withdrawalWarehouse): Customer
{
$this->withdrawalWarehouse = $withdrawalWarehouse;
return $this;
}
/**
* @return bool
*/
public function isSubscription(): bool
{
return $this->subscription;
}
/**
* @param bool $subscription
*
* @return Customer
*/
public function setSubscription(bool $subscription): Customer
{
$this->subscription = $subscription;
return $this;
}
/**
* @return int|null
*/
public function getIdService(): ?int
{
return $this->idService;
}
/**
* @param int|null $idService
*
* @return Customer
*/
public function setIdService(?int $idService): Customer
{
$this->idService = $idService;
return $this;
}
/**
* @return bool
*/
public function isReserve(): bool
{
return $this->reserve;
}
/**
* @param bool $reserve
*
* @return Customer
*/
public function setReserve(bool $reserve): Customer
{
$this->reserve = $reserve;
return $this;
}
/**
* @return bool
*/
public function isActive(): bool
{
return $this->active;
}
/**
* @param bool $active
*
* @return Customer
*/
public function setActive(bool $active): Customer
{
$this->active = $active;
return $this;
}
/**
* @return bool
*/
public function isGuest(): bool
{
return $this->isGuest;
}
/**
* @param bool $isGuest
*
* @return Customer
*/
public function setIsGuest(bool $isGuest): Customer
{
$this->isGuest = $isGuest;
return $this;
}
/**
* @return bool
*/
public function isValidVat(): bool
{
return $this->isValidVat;
}
/**
* @param bool $isValidVat
*
* @return Customer
*/
public function setIsValidVat(bool $isValidVat): Customer
{
$this->isValidVat = $isValidVat;
return $this;
}
/**
* @return bool
*/
public function isDropshipping(): bool
{
return $this->dropshipping;
}
/**
* @param bool $dropshipping
*
* @return Customer
*/
public function setDropshipping(bool $dropshipping): Customer
{
$this->dropshipping = $dropshipping;
return $this;
}
/**
* @return \DateTime
*/
public function getDateAdd(): \DateTime
{
return $this->dateAdd;
}
/**
* @param \DateTime $dateAdd
*
* @return Customer
*/
public function setDateAdd(\DateTime $dateAdd): Customer
{
$this->dateAdd = $dateAdd;
return $this;
}
/**
* @return \DateTime
*/
public function getDateUpd(): \DateTime
{
return $this->dateUpd;
}
/**
* @param \DateTime $dateUpd
*
* @return Customer
*/
public function setDateUpd(\DateTime $dateUpd): Customer
{
$this->dateUpd = $dateUpd;
return $this;
}
/**
* @return string|null
*/
public function getComment(): ?string
{
return $this->comment;
}
/**
* @param string|null $comment
*
* @return Customer
*/
public function setComment(?string $comment): Customer
{
$this->comment = $comment;
return $this;
}
/**
* @return string|null
*/
public function getCommissionAgent(): ?string
{
return $this->commissionAgent;
}
/**
* @param string|null $commissionAgent
*
* @return Customer
*/
public function setCommissionAgent(?string $commissionAgent): Customer
{
$this->commissionAgent = $commissionAgent;
return $this;
}
public function getDateCsv()
{
return $this->dateCsv;
}
public function setDateCsv($dateCsv)
{
$this->dateCsv = $dateCsv;
return $this;
}
/**
* @return \DateTime|null
*/
public function getDateBlock(): ?\DateTime
{
return $this->dateBlock;
}
/**
* @param \DateTime|null $dateBlock
*
* @return Customer
*/
public function setDateBlock(?\DateTime $dateBlock): Customer
{
$this->dateBlock = $dateBlock;
return $this;
}
/**
* @return string|null
*/
public function getPaypalBillingAgreement(): ?string
{
return $this->paypalBillingAgreement;
}
/**
* @param string|null $paypalBillingAgreement
*
* @return Customer
*/
public function setPaypalBillingAgreement(?string $paypalBillingAgreement): Customer
{
$this->paypalBillingAgreement = $paypalBillingAgreement;
return $this;
}
/**
* @return \DateTime|null
*/
public function getDatePack(): ?\DateTime
{
return $this->datePack;
}
/**
* @param \DateTime|null $datePack
*
* @return Customer
*/
public function setDatePack(?\DateTime $datePack): Customer
{
$this->datePack = $datePack;
return $this;
}
/**
* @return string|null
*/
public function getCsvLang(): ?string
{
return $this->csvLang;
}
/**
* @param string|null $csvLang
*
* @return Customer
*/
public function setCsvLang(?string $csvLang): Customer
{
$this->csvLang = $csvLang;
return $this;
}
/**
* @return string|null
*/
public function getDropshippingName(): ?string
{
return $this->dropshippingName;
}
/**
* @param string|null $dropshippingName
*
* @return Customer
*/
public function setDropshippingName(?string $dropshippingName): Customer
{
$this->dropshippingName = $dropshippingName;
return $this;
}
/**
* @return string|null
*/
public function getEmailPaypal(): ?string
{
return $this->emailPaypal;
}
/**
* @param string|null $emailPaypal
*
* @return Customer
*/
public function setEmailPaypal(?string $emailPaypal): Customer
{
$this->emailPaypal = $emailPaypal;
return $this;
}
/**
* @return bool|null
*/
public function getSincronizedErp(): ?bool
{
return $this->sincronizedErp;
}
/**
* @param bool|null $sincronizedErp
*
* @return Customer
*/
public function setSincronizedErp(?bool $sincronizedErp): Customer
{
$this->sincronizedErp = $sincronizedErp;
return $this;
}
/**
* @return bool|null
*/
public function getPromotions(): ?bool
{
return $this->promotions;
}
/**
* @param bool|null $promotions
*
* @return Customer
*/
public function setPromotions(?bool $promotions): Customer
{
$this->promotions = $promotions;
return $this;
}
/**
* @return bool|null
*/
public function getMoroso(): ?bool
{
return $this->moroso;
}
/**
* @param bool|null $moroso
*
* @return Customer
*/
public function setMoroso(?bool $moroso): Customer
{
$this->moroso = $moroso;
return $this;
}
/**
* @return bool|null
*/
public function getAvatar(): ?bool
{
return $this->avatar;
}
/**
* @param bool|null $avatar
*
* @return Customer
*/
public function setAvatar(?bool $avatar): Customer
{
$this->avatar = $avatar;
return $this;
}
/**
* @return bool|null
*/
public function getAvisoContabilidad(): ?bool
{
return $this->avisoContabilidad;
}
/**
* @param bool|null $avisoContabilidad
*
* @return Customer
*/
public function setAvisoContabilidad(?bool $avisoContabilidad): Customer
{
$this->avisoContabilidad = $avisoContabilidad;
return $this;
}
/**
* @return string|null
*/
public function getPayerIdPaypal(): ?string
{
return $this->payerIdPaypal;
}
/**
* @param string|null $payerIdPaypal
*
* @return Customer
*/
public function setPayerIdPaypal(?string $payerIdPaypal): Customer
{
$this->payerIdPaypal = $payerIdPaypal;
return $this;
}
/**
* @return bool
*/
public function isOrderCsv(): bool
{
return $this->orderCsv;
}
/**
* @param bool $orderCsv
*
* @return Customer
*/
public function setOrderCsv(bool $orderCsv): Customer
{
$this->orderCsv = $orderCsv;
return $this;
}
/**
* @return \DateTime|null
*/
public function getDateBasicFree(): ?\DateTime
{
return $this->dateBasicFree;
}
/**
* @param \DateTime|null $dateBasicFree
*
* @return Customer
*/
public function setDateBasicFree(?\DateTime $dateBasicFree): Customer
{
$this->dateBasicFree = $dateBasicFree;
return $this;
}
/**
* @return bool|null
*/
public function getExcluirVies(): ?bool
{
return $this->excluirVies;
}
/**
* @param bool|null $excluirVies
*
* @return Customer
*/
public function setExcluirVies(?bool $excluirVies): Customer
{
$this->excluirVies = $excluirVies;
return $this;
}
/**
* @return bool|null
*/
public function getBlocked(): ?bool
{
return $this->blocked;
}
/**
* @param bool|null $blocked
*
* @return Customer
*/
public function setBlocked(?bool $blocked): Customer
{
$this->blocked = $blocked;
return $this;
}
/**
* @return \DateTime|null
*/
public function getDateExcluirIva(): ?\DateTime
{
return $this->dateExcluirIva;
}
/**
* @param \DateTime|null $dateExcluirIva
*
* @return Customer
*/
public function setDateExcluirIva(?\DateTime $dateExcluirIva): Customer
{
$this->dateExcluirIva = $dateExcluirIva;
return $this;
}
/**
* @return float|null
*/
public function getDtoPersonal1(): ?float
{
return $this->dtoPersonal1;
}
/**
* @param float|null $dtoPersonal1
*
* @return Customer
*/
public function setDtoPersonal1(?float $dtoPersonal1): Customer
{
$this->dtoPersonal1 = $dtoPersonal1;
return $this;
}
/**
* @return float|null
*/
public function getDtoPersonal2(): ?float
{
return $this->dtoPersonal2;
}
/**
* @param float|null $dtoPersonal2
*
* @return Customer
*/
public function setDtoPersonal2(?float $dtoPersonal2): Customer
{
$this->dtoPersonal2 = $dtoPersonal2;
return $this;
}
/**
* @return float|null
*/
public function getDtoPersonal3(): ?float
{
return $this->dtoPersonal3;
}
/**
* @param float|null $dtoPersonal3
*
* @return Customer
*/
public function setDtoPersonal3(?float $dtoPersonal3): Customer
{
$this->dtoPersonal3 = $dtoPersonal3;
return $this;
}
/**
* @return float|null
*/
public function getImportePersonal1(): ?float
{
return $this->importePersonal1;
}
/**
* @param float|null $importePersonal1
*
* @return Customer
*/
public function setImportePersonal1(?float $importePersonal1): Customer
{
$this->importePersonal1 = $importePersonal1;
return $this;
}
/**
* @return float|null
*/
public function getImportePersonal2(): ?float
{
return $this->importePersonal2;
}
/**
* @param float|null $importePersonal2
*
* @return Customer
*/
public function setImportePersonal2(?float $importePersonal2): Customer
{
$this->importePersonal2 = $importePersonal2;
return $this;
}
/**
* @return float|null
*/
public function getImportePersonal3(): ?float
{
return $this->importePersonal3;
}
/**
* @param float|null $importePersonal3
*
* @return Customer
*/
public function setImportePersonal3(?float $importePersonal3): Customer
{
$this->importePersonal3 = $importePersonal3;
return $this;
}
/**
* @return int|null
*/
public function getCreditType(): ?int
{
return $this->creditType;
}
/**
* @param int|null $creditType
*
* @return Customer
*/
public function setCreditType(?int $creditType): Customer
{
$this->creditType = $creditType;
return $this;
}
/**
* @return int|null
*/
public function getMultichannelUserId(): ?int
{
return $this->multichannelUserId;
}
/**
* @param int|null $multichannelUserId
*
* @return Customer
*/
public function setMultichannelUserId(?int $multichannelUserId): Customer
{
$this->multichannelUserId = $multichannelUserId;
return $this;
}
/**
* @return int|null
*/
public function getTop(): ?int
{
return $this->top;
}
/**
* @param int|null $top
*
* @return Customer
*/
public function setTop(?int $top): Customer
{
$this->top = $top;
return $this;
}
/**
* @return string|null
*/
public function getKam(): ?string
{
return $this->kam;
}
/**
* @param string|null $kam
*
* @return Customer
*/
public function setKam(?string $kam): Customer
{
$this->kam = $kam;
return $this;
}
/**
* @return \DateTime|null
*/
public function getReadPolicyCookies(): ?\DateTime
{
return $this->readPolicyCookies;
}
/**
* @param \DateTime|null $readPolicyCookies
*
* @return Customer
*/
public function setReadPolicyCookies(?\DateTime $readPolicyCookies): Customer
{
$this->readPolicyCookies = $readPolicyCookies;
return $this;
}
/**
* @return string|null
*/
public function getSector(): ?string
{
return $this->sector;
}
/**
* @param string|null $sector
*
* @return Customer
*/
public function setSector(?string $sector): Customer
{
$this->sector = $sector;
return $this;
}
/**
* @return string|null
*/
public function getCatchment(): ?string
{
return $this->catchment;
}
/**
* @param string|null $catchment
*
* @return Customer
*/
public function setCatchment(?string $catchment): Customer
{
$this->catchment = $catchment;
return $this;
}
/**
* @return string|null
*/
public function getType(): ?string
{
return $this->type;
}
/**
* @param string|null $type
*
* @return Customer
*/
public function setType(?string $type): Customer
{
$this->type = $type;
return $this;
}
/**
* @return int|null
*/
public function getPackByPurse(): ?int
{
return $this->packByPurse;
}
/**
* @param int|null $packByPurse
*
* @return Customer
*/
public function setPackByPurse(?int $packByPurse): Customer
{
$this->packByPurse = $packByPurse;
return $this;
}
/**
* @return int
*/
public function getPartialCreation(): int
{
return $this->partialCreation;
}
/**
* @param int $partialCreation
*
* @return Customer
*/
public function setPartialCreation(int $partialCreation): Customer
{
$this->partialCreation = $partialCreation;
return $this;
}
/**
* @return Collection|Order[]
*/
public function getOrders(): Collection
{
return $this->orders;
}
public function addOrder(Order $order): self
{
if (!$this->orders->contains($order)) {
$this->orders[] = $order;
$order->setCustomer($this);
}
return $this;
}
public function removeOrder(Order $order): self
{
if ($this->orders->contains($order)) {
$this->orders->removeElement($order);
// set the owning side to null (unless already changed)
if ($order->getCustomer() === $this) {
$order->setCustomer(null);
}
}
return $this;
}
/**
* @return Collection|Address[]
*/
public function getAddresses(): Collection
{
return $this->addresses;
}
public function addAddress(Address $address): self
{
if (!$this->addresses->contains($address)) {
$this->addresses[] = $address;
$address->setCustomer($this);
}
return $this;
}
public function removeAddress(Address $address): self
{
if ($this->addresses->contains($address)) {
$this->addresses->removeElement($address);
// set the owning side to null (unless already changed)
if ($address->getCustomer() === $this) {
$address->setCustomer(null);
}
}
return $this;
}
/**
* @return bool|null
*/
public function getPurchaseNotAllowed(): ?bool
{
return $this->purchaseNotAllowed;
}
/**
* @param bool|null $purchaseNotAllowed
*
* @return Customer
*/
public function setPurchaseNotAllowed(?bool $purchaseNotAllowed): self
{
$this->purchaseNotAllowed = $purchaseNotAllowed;
return $this;
}
/**
* @return \DateTime|null
*/
public function getDateEnding(): ?\DateTime
{
return $this->dateEnding;
}
/**
* @param \DateTime|null $dateEnding
*
* @return Customer
*/
public function setDateEnding(?\DateTime $dateEnding): self
{
$this->dateEnding = $dateEnding;
return $this;
}
/**
* @return string|null
*/
public function getUserIdPaycomet(): ?string
{
return $this->userIdPaycomet;
}
/**
* @param string|null $userIdPaycomet
*
* @return Customer
*/
public function setUserIdPaycomet(?string $userIdPaycomet): self
{
$this->userIdPaycomet = $userIdPaycomet;
return $this;
}
/**
* @return string|null
*/
public function getUserTokenPaycomet(): ?string
{
return $this->userTokenPaycomet;
}
/**
* @param string|null $userTokenPaycomet
*
* @return Customer
*/
public function setUserTokenPaycomet(?string $userTokenPaycomet): self
{
$this->userTokenPaycomet = $userTokenPaycomet;
return $this;
}
/**
* @return FuturePack[]|ArrayCollection
*/
public function getFuturePacks()
{
return $this->futurePacks;
}
/**
* @param FuturePack[]|ArrayCollection $futurePacks
*
* @return Customer
*/
public function setFuturePacks($futurePacks)
{
$this->futurePacks = $futurePacks;
return $this;
}
/**
* @return SubscriptionLine[]|ArrayCollection
*/
public function getSubscriptionLines()
{
return $this->subscriptionLines;
}
/**
* @param SubscriptionLine[]|ArrayCollection $subscriptionLines
*
* @return Customer
*/
public function setSubscriptionLines($subscriptionLines)
{
$this->subscriptionLines = $subscriptionLines;
return $this;
}
/**
* @return ServiceCustomer[]|PersistentCollection
*/
public function getServiceCustomer(): PersistentCollection
{
return $this->serviceCustomer;
}
/**
* @param array $serviceCustomer
*/
public function setServiceCustomer(array $serviceCustomer): Customer
{
$this->serviceCustomer = $serviceCustomer;
return $this;
}
/**
* @return array
*/
public function getCustomerApi(): array
{
return $this->customerApi;
}
/**
* @param array $customerApi
*
* @return Customer
*/
public function setCustomerApi(array $customerApi): Customer
{
$this->customerApi = $customerApi;
return $this;
}
/**
* @return array
*/
public function getCustomerLog(): array
{
return $this->customerLog;
}
/**
* @param array $customerLog
*
* @return Customer
*/
public function setCustomerLog(array $customerLog): Customer
{
$this->customerLog = $customerLog;
return $this;
}
/**
* @return array
*/
public function getFtp(): array
{
return $this->ftp;
}
/**
* @param array $ftp
*
* @return Customer
*/
public function setFtp(array $ftp): Customer
{
$this->ftp = $ftp;
return $this;
}
/**
* @return array
*/
public function getSyncronisedShopConfiguration(): array
{
return $this->syncronisedShopConfiguration;
}
/**
* @param array $syncronisedShopConfiguration
*
* @return Customer
*/
public function setSyncronisedShopConfiguration(array $syncronisedShopConfiguration): Customer
{
$this->syncronisedShopConfiguration = $syncronisedShopConfiguration;
return $this;
}
/**
* @return array
*/
public function getCustomerMigration(): array
{
return $this->customerMigration;
}
/**
* @param array $customerMigration
*
* @return Customer
*/
public function setCustomerMigration(array $customerMigration): Customer
{
$this->customerMigration = $customerMigration;
return $this;
}
/**
* @return int|null
*/
public function getPaycometMit(): ?int
{
return $this->paycometMit;
}
/**
* @param int|null $paycometMit
*
* @return Customer
*/
public function setPaycometMit(?int $paycometMit): Customer
{
$this->paycometMit = $paycometMit;
return $this;
}
/**
* @return array
*/
public function getRoles(): array
{
$roleCollection = $this->roles;
$roles = [];
if ($roleCollection) {
foreach ($roleCollection as $role) {
$roleName = $role->getName();
if (!in_array($roleName, $roles, true)) {
$roles[$role->getId()] = $role->getName();
}
}
}
return $roles;
}
public function hasRole(string $queryRole): bool
{
$roleCollection = $this->roles;
$roles = [];
if ($roleCollection) {
foreach ($roleCollection as $role) {
$roleName = $role->getName();
if (!in_array($roleName, $roles, true)) {
$roles[] = $role->getName();
}
}
}
return in_array(strtoupper($queryRole), $roles, true);
}
/**
* @return Role[]|ArrayCollection
*/
public function getRoleCollection()
{
return $this->roles;
}
/**
* @param Role[]|ArrayCollection $roles
*/
public function setRoleCollection($roles): Customer
{
$this->roles = $roles;
return $this;
}
/**
* @return bool
*/
public function hasMultifactorAuthEnabled(): bool
{
return $this->multifactorAuthEnabled;
}
/**
* Resets paypal-related fields
*/
public function resetBillingAgreement(): void
{
$this->setPaypalBillingAgreement(self::ID_CUSTOMER_NOT_BILLING_AGREEMENT);
$this->setEmailPaypal('');
$this->setPayerIdPaypal('');
}
/**
* @param Customer $oldCustomer
*/
public function setPackValuesFromOldCustomer(Customer $oldCustomer): void
{
$this->group = $oldCustomer->getGroup();
$this->idPack = $oldCustomer->getIdPack();
$this->dateCsv = $oldCustomer->getDateCsv();
$this->datePack = $oldCustomer->getDatePack();
$this->payerIdPaypal = $oldCustomer->getPayerIdPaypal();
$this->emailPaypal = $oldCustomer->getEmailPaypal();
$this->reserve = $oldCustomer->isReserve();
$this->orderCsv = $oldCustomer->isOrderCsv();
$this->multichannelUserId = $oldCustomer->getMultichannelUserId();
}
/**
* @param Group $groupReference
*/
public function setValuesAfterMigration(Group $groupReference): void
{
$this->group = $groupReference;
$this->idPack = 0;
$this->dateCsv = null;
$this->datePack = null;
$this->idService = 0;
$this->multichannelUserId = 0;
}
public function resetPackAndGroup(Group $group): void
{
$this->group = $group;
$this->idPack = Pack::PACK_WITHOUT_PACK;
$this->dateCsv = null;
}
/**
* @return ArrayCollection|CustomerCatalog[]
*/
public function getCustomerCatalogs()
{
return $this->customerCatalogs;
}
/**
* @param ArrayCollection $customerCatalogs
*
* @return Customer
*/
public function setCustomerCatalogs($customerCatalogs): self
{
$this->customerCatalogs = $customerCatalogs;
return $this;
}
public function getFullName(): string
{
return $this->name.' '.$this->surnames;
}
public function setMultifactorAuthEnabled(bool $multifactorAuthEnabled): void
{
$this->multifactorAuthEnabled = $multifactorAuthEnabled;
}
public function removeAllAnswers()
{
$this->additionalInfoAnswers->clear();
}
public function addAnswers(array $answers): void
{
/** @var AdditionalInfoAnswer $answer */
foreach ($answers as $answer) {
if ($answer && !$this->additionalInfoAnswers->contains($answer)) {
$this->additionalInfoAnswers->add($answer);
}
}
}
public function getDefaultAddress()
{
foreach ($this->getAddresses() as $address) {
if ($address->isDefaultInvoiceAddress()) {
return $address;
}
}
foreach ($this->getAddresses() as $address) {
if ($address->isInvoiceAddress()) {
return $address;
}
}
return current($this->getAddresses());
}
public function getAdyenPaymentId(): ?string
{
return $this->adyenPaymentId;
}
public function setAdyenPaymentId(?string $adyenPaymentId): self
{
$this->adyenPaymentId = $adyenPaymentId;
return $this;
}
/**
* @return Wishlist[]|ArrayCollection
*/
public function getWishlists()
{
return $this->wishlists;
}
public function getThePowerMbaUserId(): ?string
{
return $this->thePowerMbaUserId;
}
public function setThePowerMbaUserId(?string $thePowerMbaUserId): self
{
$this->thePowerMbaUserId = $thePowerMbaUserId;
return $this;
}
public function getGoogleAccountId(): ?string
{
return $this->googleAccountId;
}
public function setGoogleAccountId(?string $googleAccountId): Customer
{
$this->googleAccountId = $googleAccountId;
return $this;
}
public function getLinkedinAccountId(): ?string
{
return $this->linkedinAccountId;
}
public function setLinkedinAccountId(?string $linkedinAccountId): Customer
{
$this->linkedinAccountId = $linkedinAccountId;
return $this;
}
public function getPackBankwirePayment(): ?bool
{
return $this->packBankwirePayment;
}
public function setPackBankwirePayment(bool $packBankwirePayment): Customer
{
$this->packBankwirePayment = $packBankwirePayment;
return $this;
}
public function getControlpanelMipEnabled(): ?int
{
return $this->controlpanelMipEnabled;
}
public function setControlpanelMipEnabled(?int $controlpanelMipEnabled): void
{
$this->controlpanelMipEnabled = $controlpanelMipEnabled;
}
public function getForcePasswordUpdate(): ?int
{
return $this->forcePasswordUpdate;
}
public function setForcePasswordUpdate(?int $forcePasswordUpdate): void
{
$this->forcePasswordUpdate = $forcePasswordUpdate;
}
}