src/Entity/User.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UserRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  8. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  9. use Symfony\Component\Security\Core\User\UserInterface;
  10. /**
  11.  * @ORM\Entity(repositoryClass=UserRepository::class)
  12.  * @UniqueEntity(fields={"email"}, message="There is already an account with this email")
  13.  * @ORM\HasLifecycleCallbacks
  14.  */
  15. class User extends AbstractEntity implements UserInterfacePasswordAuthenticatedUserInterface
  16. {
  17.     /**
  18.      * Administrátor
  19.      */
  20.     const ROLE_ADMIN 'ROLE_ADMIN';
  21.     /**
  22.      * Role Obchodník
  23.      */
  24.     const ROLE_MERCHANT 'ROLE_MERCHANT';
  25.     /**
  26.      * Role Zákazník
  27.      */
  28.     const ROLE_CUSTOMER 'ROLE_CUSTOMER';
  29.     /**
  30.      * Správce firmy
  31.      */
  32.     const ROLE_COMPANY_ADMIN 'ROLE_COMPANY_ADMIN';
  33.     /**
  34.      * Pracovník firmy
  35.      */
  36.     const ROLE_COMPANY_USER 'ROLE_COMPANY_USER';
  37.     /**
  38.      * @ORM\Id
  39.      * @ORM\GeneratedValue
  40.      * @ORM\Column(type="integer")
  41.      */
  42.     private $id;
  43.     /**
  44.      * @ORM\Column(type="string", length=180, unique=true)
  45.      */
  46.     private $email;
  47.     /**
  48.      * @ORM\Column(type="json")
  49.      */
  50.     private $roles = [];
  51.     /**
  52.      * @var string The hashed password
  53.      * @ORM\Column(type="string")
  54.      */
  55.     private $password;
  56.     /**
  57.      * @ORM\Column(type="boolean")
  58.      */
  59.     private $isVerified false;
  60.     /**
  61.      * @ORM\Column(type="boolean", nullable=true)
  62.      */
  63.     private $active;
  64.     /**
  65.      * @ORM\Column(type="string", length=8, nullable=true)
  66.      */
  67.     private $code;
  68.     /**
  69.      * @ORM\Column(type="integer", nullable=true)
  70.      */
  71.     private $provision;
  72.     /**
  73.      * @ORM\Column(type="string", length=128, nullable=true)
  74.      */
  75.     private $name;
  76.     /**
  77.      * @ORM\Column(type="string", length=128, nullable=true)
  78.      */
  79.     private $surname;
  80.     /**
  81.      * @ORM\Column(type="string", length=3, nullable=true)
  82.      */
  83.     private $personType;
  84.     /**
  85.      * @ORM\Column(type="string", length=32, nullable=true)
  86.      */
  87.     private $nationality;
  88.     /**
  89.      * @ORM\Column(type="string", length=4, nullable=true)
  90.      */
  91.     private $taxResidency;
  92.     /**
  93.      * @ORM\Column(type="string", length=512, nullable=true)
  94.      */
  95.     private $address;
  96.     /**
  97.      * @ORM\Column(type="string", length=255, nullable=true)
  98.      */
  99.     private $street;
  100.     /**
  101.      * @ORM\Column(type="string", length=128, nullable=true)
  102.      */
  103.     private $town;
  104.     /**
  105.      * @ORM\Column(type="string", length=6, nullable=true)
  106.      */
  107.     private $postal;
  108.     /**
  109.      * @ORM\Column(type="string", length=512, nullable=true)
  110.      */
  111.     private $address2;
  112.     /**
  113.      * @ORM\Column(type="string", length=255, nullable=true)
  114.      */
  115.     private $street2;
  116.     /**
  117.      * @ORM\Column(type="string", length=128, nullable=true)
  118.      */
  119.     private $town2;
  120.     /**
  121.      * @ORM\Column(type="string", length=6, nullable=true)
  122.      */
  123.     private $postal2;
  124.     /**
  125.      * @ORM\Column(type="string", length=32, nullable=true)
  126.      */
  127.     private $ic;
  128.     /**
  129.      * @ORM\Column(type="string", length=36, nullable=true)
  130.      */
  131.     private $dic;
  132.     /**
  133.      * @ORM\Column(type="date", nullable=true)
  134.      */
  135.     private $birthdate;
  136.     /**
  137.      * @ORM\Column(type="string", length=128, nullable=true)
  138.      */
  139.     private $phone;
  140.     /**
  141.      * @ORM\Column(type="string", length=255, nullable=true)
  142.      */
  143.     private $bankName;
  144.     /**
  145.      * @ORM\Column(type="string", length=255, nullable=true)
  146.      */
  147.     private $bankAccount;
  148.     /**
  149.      * @ORM\Column(type="string", length=128, nullable=true)
  150.      */
  151.     private $swift;
  152.     /**
  153.      * @ORM\Column(type="string", length=128, nullable=true)
  154.      */
  155.     private $iban;
  156.     /**
  157.      * @ORM\Column(type="text", nullable=true)
  158.      */
  159.     private $notes;
  160.     /**
  161.      * @ORM\Column(type="string", length=255, nullable=true)
  162.      */
  163.     private $idType;
  164.     /**
  165.      * @ORM\Column(type="string", length=255, nullable=true)
  166.      */
  167.     private $idNumber;
  168.     /**
  169.      * @ORM\Column(type="string", length=255, nullable=true)
  170.      */
  171.     private $idAuthor;
  172.     /**
  173.      * @ORM\Column(type="date", nullable=true)
  174.      */
  175.     private $idValidity;
  176.     /**
  177.      * @ORM\Column(type="string", length=255, nullable=true)
  178.      */
  179.     private $businessmanRegistrationPlace;
  180.     /**
  181.      * @ORM\Column(type="string", length=255, nullable=true)
  182.      */
  183.     private $businessmanRegistrationNumber;
  184.     /**
  185.      * @ORM\Column(type="string", length=255, nullable=true)
  186.      */
  187.     private $companyRegistrationPlace;
  188.     /**
  189.      * @ORM\Column(type="string", length=255, nullable=true)
  190.      */
  191.     private $companyRegistrationNumber;
  192.     /**
  193.      * @ORM\Column(type="string", length=255, nullable=true)
  194.      */
  195.     private $companyRegistrationPartition;
  196.     /**
  197.      * @ORM\Column(type="string", length=255, nullable=true)
  198.      */
  199.     private $companyRegistrationInsertion;
  200.     /**
  201.      * @ORM\Column(type="string", length=255, nullable=true)
  202.      */
  203.     private $companyRepresentantive;
  204.     /**
  205.      * @ORM\OneToMany(targetEntity=Order::class, mappedBy="user")
  206.      */
  207.     private $orders;
  208.     /**
  209.      * @ORM\ManyToOne(targetEntity=Company::class, inversedBy="users")
  210.      */
  211.     private $company;
  212.     /**
  213.      * @ORM\Column(type="boolean")
  214.      */
  215.     private $deleted false;
  216.     /**
  217.      * @ORM\Column(type="string", length=6, nullable=true)
  218.      */
  219.     private $bankCode;
  220.     /**
  221.      * @ORM\OneToMany(targetEntity=UserRelation::class, mappedBy="junior", fetch="EXTRA_LAZY")
  222.      */
  223.     private $bosses;
  224.     /**
  225.      * @ORM\OneToMany(targetEntity=UserRelation::class, mappedBy="boss", fetch="EXTRA_LAZY")
  226.      */
  227.     private $juniors;
  228.     /**
  229.      * @ORM\OneToMany(targetEntity=InvoiceAutomation::class, mappedBy="merchant")
  230.      */
  231.     private $invoices;
  232.     /**
  233.      * @ORM\Column(type="boolean", nullable=true)
  234.      */
  235.     private $invoiceAutomation true;
  236.     /**
  237.      * @ORM\Column(type="string", length=255, nullable=true)
  238.      */
  239.     private $bankNameEur;
  240.     /**
  241.      * @ORM\Column(type="string", length=255, nullable=true)
  242.      */
  243.     private $bankAccountEur;
  244.     /**
  245.      * @ORM\Column(type="string", length=6, nullable=true)
  246.      */
  247.     private $bankCodeEur;
  248.     /**
  249.      * @ORM\Column(type="string", length=128, nullable=true)
  250.      */
  251.     private $ibanEur;
  252.     /**
  253.      * @ORM\Column(type="string", length=128, nullable=true)
  254.      */
  255.     private $swiftEur;
  256.     /**
  257.      * @ORM\OneToMany(targetEntity=InvoiceAutomationExpand::class, mappedBy="user")
  258.      */
  259.     private $invoiceAutomationExpands;
  260.     /**
  261.      * @ORM\OneToMany(targetEntity=InterestPaidoff::class, mappedBy="createdBy")
  262.      */
  263.     private $interestPaidoffs;
  264.     /**
  265.      * @ORM\OneToMany(targetEntity=InterestPaidoffReport::class, mappedBy="createdBy")
  266.      */
  267.     private $interestPaidoffReports;
  268.     /**
  269.      * @ORM\Column(type="boolean", nullable=true)
  270.      */
  271.     private $anonymize 0;
  272.     /**
  273.      * @ORM\Column(type="string", length=3, nullable=true)
  274.      */
  275.     private $tipster;
  276.     /**
  277.      * @ORM\Column(type="boolean", nullable=true)
  278.      */
  279.     private $agreeTerms;
  280.     /**
  281.      * @ORM\Column(type="boolean", nullable=true)
  282.      */
  283.     private $agreeTerms1;
  284.     /**
  285.      * @ORM\Column(type="boolean", nullable=true)
  286.      */
  287.     private $agreeTerms2;
  288.     public function __construct()
  289.     {
  290.         $this->orders = new ArrayCollection();
  291.         $this->bosses = new ArrayCollection();
  292.         $this->juniors = new ArrayCollection();
  293.         $this->invoices = new ArrayCollection();
  294.         $this->invoiceAutomationExpands = new ArrayCollection();
  295.         $this->interestPaidoffs = new ArrayCollection();
  296.         $this->interestPaidoffReports = new ArrayCollection();
  297.     }
  298.     /**
  299.      * @return string (ID:{$this->getId()}) {$this->getUsername()}
  300.      */
  301.     public function __toString(): string
  302.     {
  303.         return "(ID:{$this->getId()}{$this->getUsername()}";
  304.     }
  305.     /**
  306.      * @return int|null
  307.      */
  308.     public function getId(): ?int
  309.     {
  310.         return $this->id;
  311.     }
  312.     /**
  313.      * @return string|null
  314.      */
  315.     public function getEmail(): ?string
  316.     {
  317.         return $this->email;
  318.     }
  319.     /**
  320.      * @param string $email
  321.      * @return $this
  322.      */
  323.     public function setEmail(string $email): self
  324.     {
  325.         $this->email $email;
  326.         return $this;
  327.     }
  328.     /**
  329.      * A visual identifier that represents this user.
  330.      *
  331.      * @see UserInterface
  332.      */
  333.     public function getUserIdentifier(): string
  334.     {
  335.         return (string)$this->email;
  336.     }
  337.     /**
  338.      * @deprecated since Symfony 5.3, use getUserIdentifier instead
  339.      */
  340.     public function getUsername(): string
  341.     {
  342.         return (string)$this->email;
  343.     }
  344.     /**
  345.      * @see UserInterface
  346.      */
  347.     public function getRoles(): array
  348.     {
  349.         $roles $this->roles;
  350.         // guarantee every user at least has ROLE_USER
  351.         //$roles[] = 'ROLE_CUSTOMER';
  352.         return array_unique($roles);
  353.     }
  354.     /**
  355.      * @param $role
  356.      * @return bool
  357.      */
  358.     public function hasRole($role){
  359.         return in_array($role$this->roles);
  360.     }
  361.     /**
  362.      * @param $role
  363.      * @return bool
  364.      */
  365.     public function revokeRole($role){
  366.         unset($this->roles[$role]);
  367.         return true;
  368.     }
  369.     /**
  370.      * @param array $roles
  371.      * @return $this
  372.      */
  373.     public function setRoles(array $roles): self
  374.     {
  375.         $this->roles $roles;
  376.         return $this;
  377.     }
  378.     /**
  379.      * @see PasswordAuthenticatedUserInterface
  380.      */
  381.     public function getPassword(): string
  382.     {
  383.         return $this->password;
  384.     }
  385.     /**
  386.      * @param string $password
  387.      * @return $this
  388.      */
  389.     public function setPassword(string $password): self
  390.     {
  391.         $this->password $password;
  392.         return $this;
  393.     }
  394.     /**
  395.      * Returning a salt is only needed, if you are not using a modern
  396.      * hashing algorithm (e.g. bcrypt or sodium) in your security.yaml.
  397.      *
  398.      * @see UserInterface
  399.      */
  400.     public function getSalt(): ?string
  401.     {
  402.         return null;
  403.     }
  404.     /**
  405.      * @see UserInterface
  406.      */
  407.     public function eraseCredentials()
  408.     {
  409.         // If you store any temporary, sensitive data on the user, clear it here
  410.         // $this->plainPassword = null;
  411.     }
  412.     /**
  413.      * @return bool
  414.      */
  415.     public function isVerified(): bool
  416.     {
  417.         return $this->isVerified;
  418.     }
  419.     /**
  420.      * @param bool $isVerified
  421.      * @return $this
  422.      */
  423.     public function setIsVerified(bool $isVerified): self
  424.     {
  425.         $this->isVerified $isVerified;
  426.         return $this;
  427.     }
  428.     /**
  429.      * @return bool|null
  430.      */
  431.     public function isActive(): ?bool
  432.     {
  433.         return $this->active;
  434.     }
  435.     /**
  436.      * @param bool|null $active
  437.      * @return $this
  438.      */
  439.     public function setActive(?bool $active): self
  440.     {
  441.         $this->active $active;
  442.         return $this;
  443.     }
  444.     /**
  445.      * @return string|null
  446.      */
  447.     public function getCode(): ?string
  448.     {
  449.         return $this->code;
  450.     }
  451.     /**
  452.      * @param string|null $code
  453.      * @return $this
  454.      */
  455.     public function setCode(?string $code): self
  456.     {
  457.         $this->code $code;
  458.         return $this;
  459.     }
  460.     /**
  461.      * @return int|null
  462.      */
  463.     public function getProvision(): ?int
  464.     {
  465.         return $this->provision;
  466.     }
  467.     /**
  468.      * @param int|null $provision
  469.      * @return $this
  470.      */
  471.     public function setProvision(?int $provision): self
  472.     {
  473.         $this->provision $provision;
  474.         return $this;
  475.     }
  476.     /**
  477.      * @return string|null
  478.      */
  479.     public function getName(): ?string
  480.     {
  481.         return $this->name;
  482.     }
  483.     /**
  484.      * @param string|null $name
  485.      * @return $this
  486.      */
  487.     public function setName(?string $name): self
  488.     {
  489.         $this->name $name;
  490.         return $this;
  491.     }
  492.     /**
  493.      * @return string|null
  494.      */
  495.     public function getSurname(): ?string
  496.     {
  497.         return $this->surname;
  498.     }
  499.     /**
  500.      * @param string|null $surname
  501.      * @return $this
  502.      */
  503.     public function setSurname(?string $surname): self
  504.     {
  505.         $this->surname $surname;
  506.         return $this;
  507.     }
  508.     /**
  509.      * @return string|null
  510.      */
  511.     public function getPersonType(): ?string
  512.     {
  513.         return $this->personType;
  514.     }
  515.     /**
  516.      * @param string|null $personType
  517.      * @return $this
  518.      */
  519.     public function setPersonType(?string $personType): self
  520.     {
  521.         $this->personType $personType;
  522.         return $this;
  523.     }
  524.     /**
  525.      * @return string|null
  526.      */
  527.     public function getNationality(): ?string
  528.     {
  529.         return $this->nationality;
  530.     }
  531.     /**
  532.      * @param string|null $nationality
  533.      * @return $this
  534.      */
  535.     public function setNationality(?string $nationality): self
  536.     {
  537.         $this->nationality $nationality;
  538.         return $this;
  539.     }
  540.     /**
  541.      * @return string|null
  542.      */
  543.     public function getTaxResidency(): ?string
  544.     {
  545.         return $this->taxResidency;
  546.     }
  547.     /**
  548.      * @param string|null $taxResidency
  549.      * @return $this
  550.      */
  551.     public function setTaxResidency(?string $taxResidency): self
  552.     {
  553.         $this->taxResidency $taxResidency;
  554.         return $this;
  555.     }
  556.     /**
  557.      * @return string|null
  558.      */
  559.     public function getAddress(): ?string
  560.     {
  561.         if (is_null($this->address)) {
  562.             return
  563.                 trim($this->getStreet() . ", " .
  564.                     $this->getTown() . ", " .
  565.                     $this->getPostal(), ", ");
  566.         }
  567.         return $this->address;
  568.     }
  569.     /**
  570.      * @param string|null $address
  571.      * @return $this
  572.      */
  573.     public function setAddress(?string $address): self
  574.     {
  575.         $this->address $address;
  576.         return $this;
  577.     }
  578.     /**
  579.      * @return string|null
  580.      */
  581.     public function getStreet(): ?string
  582.     {
  583.         return $this->street;
  584.     }
  585.     /**
  586.      * @param string|null $street
  587.      * @return $this
  588.      */
  589.     public function setStreet(?string $street): self
  590.     {
  591.         $this->street $street;
  592.         return $this;
  593.     }
  594.     /**
  595.      * @return string|null
  596.      */
  597.     public function getTown(): ?string
  598.     {
  599.         return $this->town;
  600.     }
  601.     /**
  602.      * @param string|null $town
  603.      * @return $this
  604.      */
  605.     public function setTown(?string $town): self
  606.     {
  607.         $this->town $town;
  608.         return $this;
  609.     }
  610.     /**
  611.      * @return string|null
  612.      */
  613.     public function getPostal(): ?string
  614.     {
  615.         return $this->postal;
  616.     }
  617.     /**
  618.      * @param string|null $postal
  619.      * @return $this
  620.      */
  621.     public function setPostal(?string $postal): self
  622.     {
  623.         $this->postal $postal;
  624.         return $this;
  625.     }
  626.     /**
  627.      * @return string|null
  628.      */
  629.     public function getAddress2(): ?string
  630.     {
  631.         if (is_null($this->address2)) {
  632.             return
  633.                 trim($this->getStreet2() . ", " .
  634.                     $this->getTown2() . ", " .
  635.                     $this->getPostal2(), ", ");
  636.         }
  637.         return $this->address2;
  638.     }
  639.     /**
  640.      * @param string|null $address
  641.      * @return $this
  642.      */
  643.     public function setAddress2(?string $address): self
  644.     {
  645.         $this->address2 $address;
  646.         return $this;
  647.     }
  648.     /**
  649.      * @return string|null
  650.      */
  651.     public function getStreet2(): ?string
  652.     {
  653.         return $this->street2;
  654.     }
  655.     /**
  656.      * @param string|null $street
  657.      * @return $this
  658.      */
  659.     public function setStreet2(?string $street): self
  660.     {
  661.         $this->street2 $street;
  662.         return $this;
  663.     }
  664.     /**
  665.      * @return string|null
  666.      */
  667.     public function getTown2(): ?string
  668.     {
  669.         return $this->town2;
  670.     }
  671.     /**
  672.      * @param string|null $town
  673.      * @return $this
  674.      */
  675.     public function setTown2(?string $town): self
  676.     {
  677.         $this->town2 $town;
  678.         return $this;
  679.     }
  680.     /**
  681.      * @return string|null
  682.      */
  683.     public function getPostal2(): ?string
  684.     {
  685.         return $this->postal2;
  686.     }
  687.     /**
  688.      * @param string|null $postal
  689.      * @return $this
  690.      */
  691.     public function setPostal2(?string $postal): self
  692.     {
  693.         $this->postal2 $postal;
  694.         return $this;
  695.     }
  696.     /**
  697.      * @return string|null
  698.      */
  699.     public function getIc(): ?string
  700.     {
  701.         return $this->ic;
  702.     }
  703.     /**
  704.      * @param string|null $ic
  705.      * @return $this
  706.      */
  707.     public function setIc(?string $ic): self
  708.     {
  709.         $this->ic $ic;
  710.         return $this;
  711.     }
  712.     /**
  713.      * @return string|null
  714.      */
  715.     public function getDic(): ?string
  716.     {
  717.         return $this->dic;
  718.     }
  719.     /**
  720.      * @param string|null $dic
  721.      * @return $this
  722.      */
  723.     public function setDic(?string $dic): self
  724.     {
  725.         $this->dic $dic;
  726.         return $this;
  727.     }
  728.     /**
  729.      * @return \DateTimeInterface|null
  730.      */
  731.     public function getBirthdate(): ?\DateTimeInterface
  732.     {
  733.         return $this->birthdate;
  734.     }
  735.     /**
  736.      * @param \DateTimeInterface|null $birthdate
  737.      * @return $this
  738.      */
  739.     public function setBirthdate(?\DateTimeInterface $birthdate): self
  740.     {
  741.         $this->birthdate $birthdate;
  742.         return $this;
  743.     }
  744.     /**
  745.      * @return string|null
  746.      */
  747.     public function getPhone(): ?string
  748.     {
  749.         return $this->phone;
  750.     }
  751.     /**
  752.      * @param string|null $phone
  753.      * @return $this
  754.      */
  755.     public function setPhone(?string $phone): self
  756.     {
  757.         $this->phone $phone;
  758.         return $this;
  759.     }
  760.     /**
  761.      * @return string|null
  762.      */
  763.     public function getBankName(): ?string
  764.     {
  765.         return $this->bankName;
  766.     }
  767.     /**
  768.      * @param string|null $bankName
  769.      * @return $this
  770.      */
  771.     public function setBankName(?string $bankName): self
  772.     {
  773.         $this->bankName $bankName;
  774.         return $this;
  775.     }
  776.     /**
  777.      * @return string|null
  778.      */
  779.     public function getBankAccount(): ?string
  780.     {
  781.         return $this->bankAccount;
  782.     }
  783.     /**
  784.      * @param string|null $bankAccount
  785.      * @return $this
  786.      */
  787.     public function setBankAccount(?string $bankAccount): self
  788.     {
  789.         $this->bankAccount $bankAccount;
  790.         return $this;
  791.     }
  792.     /**
  793.      * @return string|null
  794.      */
  795.     public function getSwift(): ?string
  796.     {
  797.         return $this->swift;
  798.     }
  799.     /**
  800.      * @param string|null $swift
  801.      * @return $this
  802.      */
  803.     public function setSwift(?string $swift): self
  804.     {
  805.         $this->swift $swift;
  806.         return $this;
  807.     }
  808.     /**
  809.      * @return string|null
  810.      */
  811.     public function getIban(): ?string
  812.     {
  813.         return $this->iban;
  814.     }
  815.     /**
  816.      * @param string|null $iban
  817.      * @return $this
  818.      */
  819.     public function setIban(?string $iban): self
  820.     {
  821.         $this->iban $iban;
  822.         return $this;
  823.     }
  824.     /**
  825.      * @return string|null
  826.      */
  827.     public function getNotes(): ?string
  828.     {
  829.         return $this->notes;
  830.     }
  831.     /**
  832.      * @param string|null $notes
  833.      * @return $this
  834.      */
  835.     public function setNotes(?string $notes): self
  836.     {
  837.         $this->notes $notes;
  838.         return $this;
  839.     }
  840.     /**
  841.      * @return string|null
  842.      */
  843.     public function getIdType(): ?string
  844.     {
  845.         return $this->idType;
  846.     }
  847.     /**
  848.      * @param string|null $idType
  849.      * @return $this
  850.      */
  851.     public function setIdType(?string $idType): self
  852.     {
  853.         $this->idType $idType;
  854.         return $this;
  855.     }
  856.     /**
  857.      * @return string|null
  858.      */
  859.     public function getIdNumber(): ?string
  860.     {
  861.         return $this->idNumber;
  862.     }
  863.     /**
  864.      * @param string|null $idNumber
  865.      * @return $this
  866.      */
  867.     public function setIdNumber(?string $idNumber): self
  868.     {
  869.         $this->idNumber $idNumber;
  870.         return $this;
  871.     }
  872.     /**
  873.      * @return string|null
  874.      */
  875.     public function getIdAuthor(): ?string
  876.     {
  877.         return $this->idAuthor;
  878.     }
  879.     /**
  880.      * @param string|null $idAuthor
  881.      * @return $this
  882.      */
  883.     public function setIdAuthor(?string $idAuthor): self
  884.     {
  885.         $this->idAuthor $idAuthor;
  886.         return $this;
  887.     }
  888.     /**
  889.      * @return \DateTimeInterface|null
  890.      */
  891.     public function getIdValidity(): ?\DateTimeInterface
  892.     {
  893.         return $this->idValidity;
  894.     }
  895.     /**
  896.      * @param \DateTimeInterface|null $idValidity
  897.      * @return $this
  898.      */
  899.     public function setIdValidity(?\DateTimeInterface $idValidity): self
  900.     {
  901.         $this->idValidity $idValidity;
  902.         return $this;
  903.     }
  904.     /**
  905.      * @return string|null
  906.      */
  907.     public function getBusinessmanRegistrationPlace(): ?string
  908.     {
  909.         return $this->businessmanRegistrationPlace;
  910.     }
  911.     /**
  912.      * @param string|null $businessmanRegistrationPlace
  913.      * @return $this
  914.      */
  915.     public function setBusinessmanRegistrationPlace(?string $businessmanRegistrationPlace): self
  916.     {
  917.         $this->businessmanRegistrationPlace $businessmanRegistrationPlace;
  918.         return $this;
  919.     }
  920.     /**
  921.      * @return string|null
  922.      */
  923.     public function getBusinessmanRegistrationNumber(): ?string
  924.     {
  925.         return $this->businessmanRegistrationNumber;
  926.     }
  927.     /**
  928.      * @param string|null $businessmanRegistrationNumber
  929.      * @return $this
  930.      */
  931.     public function setBusinessmanRegistrationNumber(?string $businessmanRegistrationNumber): self
  932.     {
  933.         $this->businessmanRegistrationNumber $businessmanRegistrationNumber;
  934.         return $this;
  935.     }
  936.     /**
  937.      * @return string|null
  938.      */
  939.     public function getCompanyRegistrationPlace(): ?string
  940.     {
  941.         return $this->companyRegistrationPlace;
  942.     }
  943.     /**
  944.      * @param string|null $companyRegistrationPlace
  945.      * @return $this
  946.      */
  947.     public function setCompanyRegistrationPlace(?string $companyRegistrationPlace): self
  948.     {
  949.         $this->companyRegistrationPlace $companyRegistrationPlace;
  950.         return $this;
  951.     }
  952.     /**
  953.      * @return string|null
  954.      */
  955.     public function getCompanyRegistrationNumber(): ?string
  956.     {
  957.         return $this->companyRegistrationNumber;
  958.     }
  959.     /**
  960.      * @param string|null $companyRegistrationNumber
  961.      * @return $this
  962.      */
  963.     public function setCompanyRegistrationNumber(?string $companyRegistrationNumber): self
  964.     {
  965.         $this->companyRegistrationNumber $companyRegistrationNumber;
  966.         return $this;
  967.     }
  968.     /**
  969.      * @return string|null
  970.      */
  971.     public function getCompanyRegistrationPartition(): ?string
  972.     {
  973.         return $this->companyRegistrationPartition;
  974.     }
  975.     /**
  976.      * @param string|null $companyRegistrationPartition
  977.      * @return $this
  978.      */
  979.     public function setCompanyRegistrationPartition(?string $companyRegistrationPartition): self
  980.     {
  981.         $this->companyRegistrationPartition $companyRegistrationPartition;
  982.         return $this;
  983.     }
  984.     /**
  985.      * @return string|null
  986.      */
  987.     public function getCompanyRegistrationInsertion(): ?string
  988.     {
  989.         return $this->companyRegistrationInsertion;
  990.     }
  991.     /**
  992.      * @param string|null $companyRegistrationInsertion
  993.      * @return $this
  994.      */
  995.     public function setCompanyRegistrationInsertion(?string $companyRegistrationInsertion): self
  996.     {
  997.         $this->companyRegistrationInsertion $companyRegistrationInsertion;
  998.         return $this;
  999.     }
  1000.     /**
  1001.      * @return string|null
  1002.      */
  1003.     public function getCompanyRepresentantive(): ?string
  1004.     {
  1005.         return $this->companyRepresentantive;
  1006.     }
  1007.     /**
  1008.      * @param string|null $companyRepresentantive
  1009.      * @return $this
  1010.      */
  1011.     public function setCompanyRepresentantive(?string $companyRepresentantive): self
  1012.     {
  1013.         $this->companyRepresentantive $companyRepresentantive;
  1014.         return $this;
  1015.     }
  1016.     /**
  1017.      * @return Collection<int, Order>
  1018.      */
  1019.     public function getOrders(): Collection
  1020.     {
  1021.         return $this->orders;
  1022.     }
  1023.     public function addOrder(Order $order): self
  1024.     {
  1025.         if (!$this->orders->contains($order)) {
  1026.             $this->orders[] = $order;
  1027.             $order->setUser($this);
  1028.         }
  1029.         return $this;
  1030.     }
  1031.     public function removeOrder(Order $order): self
  1032.     {
  1033.         if ($this->orders->removeElement($order)) {
  1034.             // set the owning side to null (unless already changed)
  1035.             if ($order->getUser() === $this) {
  1036.                 $order->setUser(null);
  1037.             }
  1038.         }
  1039.         return $this;
  1040.     }
  1041.     public function getCompany(): ?Company
  1042.     {
  1043.         return $this->company;
  1044.     }
  1045.     public function setCompany(?Company $company): self
  1046.     {
  1047.         $this->company $company;
  1048.         return $this;
  1049.     }
  1050.     public function isDeleted(): ?bool
  1051.     {
  1052.         return $this->deleted;
  1053.     }
  1054.     public function setDeleted(bool $deleted): self
  1055.     {
  1056.         $this->deleted $deleted;
  1057.         return $this;
  1058.     }
  1059.     public function getBankCode(): ?string
  1060.     {
  1061.         return $this->bankCode;
  1062.     }
  1063.     public function setBankCode(?string $bankCode): self
  1064.     {
  1065.         $this->bankCode $bankCode;
  1066.         return $this;
  1067.     }
  1068. //    public function getRelations(){
  1069. //
  1070. //    }
  1071. //    public function addRelation(){
  1072. //
  1073. //    }
  1074. //
  1075. //    public function removeRelation(){
  1076. //
  1077. //    }
  1078. //
  1079. //    public function getBosses(){
  1080. //        $this->relations->filter(function(){
  1081. //
  1082. //        });
  1083. //    }
  1084.     public function setBosses(Collection $bosses){
  1085.         $this->bosses $bosses;
  1086.     }
  1087.     /**
  1088.      * @return Collection<int, UserRelation>
  1089.      */
  1090.     public function getBosses($userRelation UserRelation::TYPE_STRUCTURE): Collection
  1091.     {
  1092.         if(is_null($userRelation) == false
  1093.             && ($userRelation == UserRelation::TYPE_REWARD || $userRelation == UserRelation::TYPE_STRUCTURE)){
  1094.             $filtered $this->bosses->filter(function(UserRelation $relation) use ($userRelation){
  1095.                 return $relation->getRelationType() == $userRelation;
  1096.             });
  1097.             return $filtered;
  1098.         }
  1099.         return $this->bosses;
  1100.     }
  1101.     public function addBoss(UserRelation $boss): self
  1102.     {
  1103.         if (!$this->bosses->contains($boss)) {
  1104.             $this->bosses[] = $boss;
  1105.             $boss->setBoss($this);
  1106.         }
  1107.         return $this;
  1108.     }
  1109.     public function removeBoss(UserRelation $boss): self
  1110.     {
  1111.         if ($this->bosses->removeElement($boss)) {
  1112.             // set the owning side to null (unless already changed)
  1113.             if ($boss->getBoss() === $this) {
  1114.                 $boss->setBoss(null);
  1115.             }
  1116.         }
  1117.         return $this;
  1118.     }
  1119.     /**
  1120.      * @return Collection<int, UserRelation>
  1121.      */
  1122.     public function getJuniors($kind UserRelation::TYPE_STRUCTURE): Collection
  1123.     {
  1124.         if(is_null($kind) == false && ($kind == UserRelation::TYPE_REWARD || $kind == UserRelation::TYPE_STRUCTURE)){
  1125.             $filtered $this->juniors->filter(function(UserRelation $relation) use ($kind){
  1126.                 return $relation->getRelationType() == $kind;
  1127.             });
  1128.             return $filtered;
  1129.         }
  1130.         return $this->juniors;
  1131.     }
  1132.     public function addJunior(UserRelation $junior): self
  1133.     {
  1134.         if (!$this->juniors->contains($junior)) {
  1135.             $this->juniors[] = $junior;
  1136.             $junior->setJunior($this);
  1137.         }
  1138.         return $this;
  1139.     }
  1140.     public function removeJunior(UserRelation $junior): self
  1141.     {
  1142.         if ($this->juniors->removeElement($junior)) {
  1143.             // set the owning side to null (unless already changed)
  1144.             if ($junior->getJunior() === $this) {
  1145.                 $junior->setJunior(null);
  1146.             }
  1147.         }
  1148.         return $this;
  1149.     }
  1150.     /**
  1151.      * @return Collection<int, InterestPaidoff>
  1152.      */
  1153.     public function getInterestPaidoffs(): Collection
  1154.     {
  1155.         return $this->interestPaidoffs;
  1156.     }
  1157.     public function addInterestPaidoff(InterestPaidoff $interestPaidoff): self
  1158.     {
  1159.         if (!$this->interestPaidoffs->contains($interestPaidoff)) {
  1160.             $this->interestPaidoffs[] = $interestPaidoff;
  1161.             $interestPaidoff->setCreatedBy($this);
  1162.         }
  1163.         return $this;
  1164.     }
  1165.     public function removeInterestPaidoff(InterestPaidoff $interestPaidoff): self
  1166.     {
  1167.         if ($this->interestPaidoffs->removeElement($interestPaidoff)) {
  1168.             // set the owning side to null (unless already changed)
  1169.             if ($interestPaidoff->getCreatedBy() === $this) {
  1170.                 $interestPaidoff->setCreatedBy(null);
  1171.             }
  1172.         }
  1173.         return $this;
  1174.     }
  1175.     /**
  1176.      * @return Collection<int, InterestPaidoffReport>
  1177.      */
  1178.     public function getInterestPaidoffReports(): Collection
  1179.     {
  1180.         return $this->interestPaidoffReports;
  1181.     }
  1182.     public function addInterestPaidoffReport(InterestPaidoffReport $interestPaidoffReport): self
  1183.     {
  1184.         if (!$this->interestPaidoffReports->contains($interestPaidoffReport)) {
  1185.             $this->interestPaidoffReports[] = $interestPaidoffReport;
  1186.             $interestPaidoffReport->setCreatedBy($this);
  1187.         }
  1188.         return $this;
  1189.     }
  1190.     public function removeInterestPaidoffReport(InterestPaidoffReport $interestPaidoffReport): self
  1191.     {
  1192.         if ($this->interestPaidoffReports->removeElement($interestPaidoffReport)) {
  1193.             // set the owning side to null (unless already changed)
  1194.             if ($interestPaidoffReport->getCreatedBy() === $this) {
  1195.                 $interestPaidoffReport->setCreatedBy(null);
  1196.             }
  1197.         }
  1198.         return $this;
  1199.     }
  1200.     /**
  1201.      * @return Collection<int, InvoiceAutomation>
  1202.      */
  1203.     public function getInvoices(): Collection
  1204.     {
  1205.         return $this->invoices;
  1206.     }
  1207.     public function addInvoice(InvoiceAutomation $invoice): self
  1208.     {
  1209.         if (!$this->invoices->contains($invoice)) {
  1210.             $this->invoices[] = $invoice;
  1211.             $invoice->setMerchant($this);
  1212.         }
  1213.         return $this;
  1214.     }
  1215.     public function removeInvoice(InvoiceAutomation $invoice): self
  1216.     {
  1217.         if ($this->invoices->removeElement($invoice)) {
  1218.             // set the owning side to null (unless already changed)
  1219.             if ($invoice->getMerchant() === $this) {
  1220.                 $invoice->setMerchant(null);
  1221.             }
  1222.         }
  1223.         return $this;
  1224.     }
  1225.     public function isInvoiceAutomation(): ?bool
  1226.     {
  1227.         return (bool)$this->invoiceAutomation;
  1228.     }
  1229.     public function setInvoiceAutomation(?bool $invoiceAutomation): self
  1230.     {
  1231.         $this->invoiceAutomation $invoiceAutomation;
  1232.         return $this;
  1233.     }
  1234.     public function getBankNameEur(): ?string
  1235.     {
  1236.         return $this->bankNameEur;
  1237.     }
  1238.     public function setBankNameEur(?string $bankNameEur): self
  1239.     {
  1240.         $this->bankNameEur $bankNameEur;
  1241.         return $this;
  1242.     }
  1243.     public function getBankAccountEur(): ?string
  1244.     {
  1245.         return $this->bankAccountEur;
  1246.     }
  1247.     public function setBankAccountEur(?string $bankAccountEur): self
  1248.     {
  1249.         $this->bankAccountEur $bankAccountEur;
  1250.         return $this;
  1251.     }
  1252.     public function getBankCodeEur(): ?string
  1253.     {
  1254.         return $this->bankCodeEur;
  1255.     }
  1256.     public function setBankCodeEur(?string $bankCodeEur): self
  1257.     {
  1258.         $this->bankCodeEur $bankCodeEur;
  1259.         return $this;
  1260.     }
  1261.     public function getIbanEur(): ?string
  1262.     {
  1263.         return $this->ibanEur;
  1264.     }
  1265.     public function setIbanEur(?string $ibanEur): self
  1266.     {
  1267.         $this->ibanEur $ibanEur;
  1268.         return $this;
  1269.     }
  1270.     public function getSwiftEur(): ?string
  1271.     {
  1272.         return $this->swiftEur;
  1273.     }
  1274.     public function setSwiftEur(?string $swiftEur): self
  1275.     {
  1276.         $this->swiftEur $swiftEur;
  1277.         return $this;
  1278.     }
  1279.     /**
  1280.      * @return Collection<int, InvoiceAutomationExpand>
  1281.      */
  1282.     public function getInvoiceAutomationExpands(): Collection
  1283.     {
  1284.         return $this->invoiceAutomationExpands;
  1285.     }
  1286.     public function addInvoiceAutomationExpand(InvoiceAutomationExpand $invoiceAutomationExpand): self
  1287.     {
  1288.         if (!$this->invoiceAutomationExpands->contains($invoiceAutomationExpand)) {
  1289.             $this->invoiceAutomationExpands[] = $invoiceAutomationExpand;
  1290.             $invoiceAutomationExpand->setUser($this);
  1291.         }
  1292.         return $this;
  1293.     }
  1294.     public function removeInvoiceAutomationExpand(InvoiceAutomationExpand $invoiceAutomationExpand): self
  1295.     {
  1296.         if ($this->invoiceAutomationExpands->removeElement($invoiceAutomationExpand)) {
  1297.             // set the owning side to null (unless already changed)
  1298.             if ($invoiceAutomationExpand->getUser() === $this) {
  1299.                 $invoiceAutomationExpand->setUser(null);
  1300.             }
  1301.         }
  1302.         return $this;
  1303.     }
  1304.     public function isAnonymize(): ?bool
  1305.     {
  1306.         return (bool)$this->anonymize;
  1307.     }
  1308.     public function setAnonymize(?bool $anonymize): self
  1309.     {
  1310.         $this->anonymize $anonymize;
  1311.         return $this;
  1312.     }
  1313.     public function getTipster(): ?int
  1314.     {
  1315.         return (int)$this->tipster;
  1316.     }
  1317.     public function setTipster(?string $tipster): self
  1318.     {
  1319.         $this->tipster $tipster;
  1320.         return $this;
  1321.     }
  1322.     public function isAgreeTerms(): ?bool
  1323.     {
  1324.         return $this->agreeTerms;
  1325.     }
  1326.     public function setAgreeTerms(?bool $agreeTerms): self
  1327.     {
  1328.         $this->agreeTerms $agreeTerms;
  1329.         return $this;
  1330.     }
  1331.     public function isAgreeTerms1(): ?bool
  1332.     {
  1333.         return $this->agreeTerms1;
  1334.     }
  1335.     public function setAgreeTerms1(?bool $agreeTerms1): self
  1336.     {
  1337.         $this->agreeTerms1 $agreeTerms1;
  1338.         return $this;
  1339.     }
  1340.     public function isAgreeTerms2(): ?bool
  1341.     {
  1342.         return $this->agreeTerms2;
  1343.     }
  1344.     public function setAgreeTerms2(?bool $agreeTerms2): self
  1345.     {
  1346.         $this->agreeTerms2 $agreeTerms2;
  1347.         return $this;
  1348.     }
  1349. }