src/Entity/User.php line 30

Open in your IDE?
  1. <?php
  2. // src/AppBundle/Entity/User.php
  3. namespace App\Entity;
  4. use Knp\DoctrineBehaviors\Contract\Entity\SoftDeletableInterface;
  5. use Knp\DoctrineBehaviors\Model\SoftDeletable\SoftDeletableTrait;
  6. use Knp\DoctrineBehaviors\Model\Blameable\BlameableTrait;
  7. use Knp\DoctrineBehaviors\Contract\Entity\BlameableInterface;
  8. use Knp\DoctrineBehaviors\Model\Timestampable\TimestampableTrait;
  9. use Knp\DoctrineBehaviors\Contract\Entity\TimestampableInterface;
  10. use Doctrine\Common\Collections\ArrayCollection;
  11. use Doctrine\Common\Collections\Collection;
  12. use Nucleos\UserBundle\Model\User as BaseUser;
  13. use Nucleos\UserBundle\Model\Group as BaseGroup;
  14. use Doctrine\ORM\Mapping as ORM;
  15. use Symfony\Component\HttpFoundation\File\File;
  16. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  17. /**
  18.  * @ORM\Entity
  19.  * @ORM\Table(name="fos_user", uniqueConstraints={@ORM\UniqueConstraint(name="user_code_idx", columns={"code"})})
  20.  * @ORM\HasLifecycleCallbacks
  21.  * @UniqueEntity(fields="usernameCanonical", errorPath="username", message="fos_user.username.already_used")
  22.  * @ORM\AttributeOverrides({
  23.  *      @ORM\AttributeOverride(name="email", column=@ORM\Column(type="string", name="email", length=255, unique=false, nullable=true)),
  24.  *      @ORM\AttributeOverride(name="emailCanonical", column=@ORM\Column(type="string", name="email_canonical", length=255, unique=false, nullable=true))
  25.  * })
  26.  */
  27. class User extends BaseUser implements BlameableInterfaceTimestampableInterfaceSoftDeletableInterface  {
  28.     use BlameableTrait;
  29.     use TimestampableTrait;
  30.     use SoftDeletableTrait;
  31.     const TYPE_WORKER 1;
  32.     const TYPE_CUSTOMER 0;
  33.     const ROLE_ADMIN 'ROLE_ADMIN';
  34.     const ROLE_CUSTOMER 'ROLE_CUSTOMER';
  35.     const ROLE_CUSTOMER_UNREGISTERED 'ROLE_CUSTOMER_UNREGISTERED';
  36.     const ROLE_CUSTOMER_REGISTERED 'ROLE_CUSTOMER_REGISTERED';
  37.     /**
  38.      * @ORM\Id
  39.      * @ORM\Column(type="integer")
  40.      * @ORM\GeneratedValue(strategy="AUTO")
  41.      */
  42.     protected $id;
  43.     public function __construct()
  44.     {
  45.         parent::__construct();
  46.         $this->comments = new ArrayCollection();
  47.         $this->notifications = new ArrayCollection();
  48.         $this->manageLanguages = new ArrayCollection();
  49.         // your own logic
  50.         $this->orders = new ArrayCollection();
  51.     }
  52.     public function getFullName()
  53.     {
  54.         return $this->firstname.' '.$this->surname;
  55.     }
  56.     public function isAdmin()
  57.     {
  58.         return $this->userGroup && $this->userGroup->getId() === true false;
  59.     }
  60.     /**
  61.      * Generate $length random code
  62.      * @param int $length (number of chars
  63.      * @return string
  64.      */
  65.     public function generateCode($length) {
  66.         $code md5(uniqid(rand(), true));
  67.         $kod substr($code0$length);
  68.         return $kod;
  69.     }
  70.     /**
  71.      * @var string
  72.      *
  73.      * @ORM\Column(name="code", type="string", length=255, nullable=true)
  74.      */
  75.     private $code;
  76.     /**
  77.      * @var string
  78.      *
  79.      * @ORM\Column(name="salt", type="string", length=255, nullable=true)
  80.      */
  81.     private $salt;
  82.     /**
  83.      * @var string
  84.      *
  85.      * @ORM\Column(name="login", type="string", length=255, nullable=true)
  86.      */
  87.     private $login;
  88.     /**
  89.      * @var string
  90.      *
  91.      * @ORM\Column(name="firstname", type="string", length=255, nullable=true)
  92.      */
  93.     private $firstname;
  94.     /**
  95.      * @var string
  96.      *
  97.      * @ORM\Column(name="phone", type="string", length=255, nullable=true)
  98.      */
  99.     private $phone;
  100.     /**
  101.      * @var string
  102.      *
  103.      * @ORM\Column(name="first_login", type="integer", length=1, nullable=true, options={"default" = 1})
  104.      */
  105.     private $firstLogin 1;
  106.     /**
  107.      * @var string
  108.      *
  109.      * @ORM\Column(name="profile_picture", type="string", length=255, nullable=true)
  110.      */
  111.     private $profilePicture;
  112.     /**
  113.      * @var string
  114.      *
  115.      * @ORM\Column(name="fb_token", type="string", length=255, nullable=true)
  116.      */
  117.     private $fbToken;
  118.     /**
  119.      * @var string
  120.      *
  121.      * @ORM\Column(name="fb_name", type="string", length=255, nullable=true)
  122.      */
  123.     private $fbName;
  124.     /**
  125.      * @var string
  126.      *
  127.      * @ORM\Column(name="fb_id", type="string", length=255, nullable=true)
  128.      */
  129.     private $fbId;
  130.     /**
  131.      * @var string
  132.      *
  133.      * @ORM\Column(name="surname", type="string", length=255, nullable=true)
  134.      */
  135.     private $surname;
  136.     /**
  137.      * @var string
  138.      *
  139.      * @ORM\Column(name="street_housenum", type="string", length=255, nullable=true)
  140.      */
  141.     protected $streetHousenum;
  142.     /**
  143.      * @ORM\OneToMany(targetEntity="App\Entity\ProductComment", mappedBy="user", cascade={"all"})
  144.      */
  145.     protected $comments;
  146.     /**
  147.      * @ORM\OneToMany(targetEntity="App\Entity\Order", mappedBy="user", cascade={"all"})
  148.      */
  149.     protected $orders;
  150.     /**
  151.      * @ORM\OneToMany(targetEntity="App\Entity\Notification", mappedBy="user", cascade={"all"})
  152.      */
  153.     protected $notifications;
  154.     /**
  155.      * @ORM\ManyToOne(targetEntity="App\Entity\Address", cascade={"all"})
  156.      * @ORM\JoinColumn(name="address_id", referencedColumnName="id", onDelete="CASCADE")
  157.      */
  158.     protected $address;
  159.     /**
  160.      * @ORM\ManyToOne(targetEntity="App\Entity\Address", cascade={"all"})
  161.      * @ORM\JoinColumn(name="invoice_address_id", referencedColumnName="id", onDelete="CASCADE")
  162.      */
  163.     protected $invoiceAddress;
  164.     /**
  165.      * @ORM\ManyToOne(targetEntity="App\Entity\Address", cascade={"all"})
  166.      * @ORM\JoinColumn(name="default_address_id", referencedColumnName="id", onDelete="CASCADE")
  167.      */
  168.     protected $defaultAddress;
  169.     /**
  170.      * @ORM\ManyToOne(targetEntity="App\Entity\Address", cascade={"all"})
  171.      * @ORM\JoinColumn(name="default_invoice_address_id", referencedColumnName="id", onDelete="CASCADE")
  172.      */
  173.     protected $defaultInvoiceAddress;
  174.     /**
  175.      * @Doctrine\ORM\Mapping\ManyToOne(targetEntity="App\Entity\Language")
  176.      * @Doctrine\ORM\Mapping\JoinColumn(name="lang_id", referencedColumnName="id")
  177.      */
  178.     protected $language;
  179.     /**
  180.      * Pracownik obsługujący sklep czy klient w sklepie internetowym?
  181.      * @Doctrine\ORM\Mapping\Column(name="user_type", type="boolean", options={"default"=0}, nullable=true)
  182.      */
  183.     protected $type;
  184.     /**
  185.      * @Doctrine\ORM\Mapping\Column(name="registered", type="boolean", options={"default"=0}, nullable=true)
  186.      */
  187.     protected $registered;
  188.     /**
  189.      * @Doctrine\ORM\Mapping\Column(name="different_invoice_address", type="boolean", options={"default"=0}, nullable=true)
  190.      */
  191.     protected $differentInvoiceAddress;
  192.     /**
  193.      * @Doctrine\ORM\Mapping\Column(name="different_delivery_address", type="boolean", options={"default"=0}, nullable=true)
  194.      */
  195.     protected $differentDeliveryAddress;
  196.     /**
  197.      * @Doctrine\ORM\Mapping\Column(name="term_condition_agree", type="boolean", options={"default"=0}, nullable=true)
  198.      */
  199.     protected $termConditionAgree;
  200.     /**
  201.      * @Doctrine\ORM\Mapping\Column(name="opinion_agree", type="boolean", options={"default"=0}, nullable=true)
  202.      */
  203.     protected $opinionAgree;
  204.     /**
  205.      * @Doctrine\ORM\Mapping\Column(name="marketing_agree", type="boolean", options={"default"=0}, nullable=true)
  206.      */
  207.     protected $marketingAgree;
  208.     /**
  209.      * @Doctrine\ORM\Mapping\Column(name="agree_all_select", type="boolean", options={"default"=0}, nullable=true)
  210.      */
  211.     protected $agreeAllSelect;
  212.     /**
  213.      * @var string
  214.      *
  215.      * @ORM\Column(name="street", type="string", length=255, nullable=true)
  216.      */
  217.     protected $street;
  218.     /**
  219.      * @var string
  220.      *
  221.      * @ORM\Column(name="citycode", type="string", length=255, nullable=true)
  222.      */
  223.     protected $citycode;
  224.     /**
  225.      * @ORM\ManyToOne(targetEntity="App\Entity\Country")
  226.      * @ORM\JoinColumn(name="country_id", referencedColumnName="id")
  227.      */
  228.     protected $country;
  229.     /**
  230.      * @var string
  231.      *
  232.      * @ORM\Column(name="city", type="string", length=255, nullable=true)
  233.      */
  234.     protected $city;
  235.     /**
  236.      * @Doctrine\ORM\Mapping\ManyToOne(targetEntity="App\Entity\UserGroup", inversedBy="users")
  237.      * @Doctrine\ORM\Mapping\JoinColumn(name="userGroup", referencedColumnName="id")
  238.      */
  239.     protected $userGroup;
  240.     /**
  241.      * Wersje językowe, którymi może zarządzać
  242.      * @Doctrine\ORM\Mapping\ManyToMany(targetEntity="App\Entity\Language")
  243.      * @Doctrine\ORM\Mapping\JoinTable(name="user_managed_languages",
  244.      *      joinColumns={@Doctrine\ORM\Mapping\JoinColumn(name="user_id", referencedColumnName="id")},
  245.      *      inverseJoinColumns={@Doctrine\ORM\Mapping\JoinColumn(name="language_id", referencedColumnName="id")}
  246.      *      )
  247.      **/
  248.     protected $manageLanguages;
  249.     /**
  250.      * @ORM\ManyToOne(targetEntity="App\Entity\RoJudet")
  251.      */
  252.     private $roJudet;
  253.     /**
  254.      * Kiedy ostatni raz było zmieniane hasło
  255.      * @Doctrine\ORM\Mapping\Column(type="datetime", nullable=true)
  256.      */
  257.     protected $passwordChangedAt;
  258.     /**
  259.      * Wysłanie e-maila potwierdzającego założenie konta
  260.      * @Doctrine\ORM\Mapping\Column(type="datetime", nullable=true)
  261.      */
  262.     protected $confirmationEmailAt;
  263.     /**
  264.      * @var string
  265.      *
  266.      * @ORM\Column(name="register_confirmation_token", type="string", length=255, nullable=true)
  267.      */
  268.     protected $registerConfirmationToken;
  269.     /**
  270.      * @Doctrine\ORM\Mapping\Column(name="confirmed", type="boolean", nullable=true, options={"default" = 0})
  271.      */
  272.     protected $confirmed false;
  273.     /**
  274.      * @Doctrine\ORM\Mapping\Column(name="consent_feedback", type="boolean", nullable=true)
  275.      */
  276.     protected $consentFeedback false;
  277.     /**
  278.      * @return bool
  279.      */
  280.     public function isConsentFeedback(): bool
  281.     {
  282.         return $this->consentFeedback;
  283.     }
  284.     /**
  285.      * @param bool $consentFeedback
  286.      */
  287.     public function setConsentFeedback(bool $consentFeedback)
  288.     {
  289.         $this->consentFeedback $consentFeedback;
  290.     }
  291.     /**
  292.      * Set code
  293.      *
  294.      * @param string $code
  295.      *
  296.      * @return User
  297.      */
  298.     public function setCode($code)
  299.     {
  300.         $this->code $code;
  301.         return $this;
  302.     }
  303.     /**
  304.      * Get code
  305.      *
  306.      * @return string
  307.      */
  308.     public function getCode()
  309.     {
  310.         return $this->code;
  311.     }
  312.     /**
  313.      * Set login
  314.      *
  315.      * @param string $login
  316.      *
  317.      * @return User
  318.      */
  319.     public function setLogin($login)
  320.     {
  321.         $this->login $login;
  322.         return $this;
  323.     }
  324.     /**
  325.      * Get login
  326.      *
  327.      * @return string
  328.      */
  329.     public function getLogin()
  330.     {
  331.         return $this->login;
  332.     }
  333.     /**
  334.      * Set firstname
  335.      *
  336.      * @param string $firstname
  337.      *
  338.      * @return User
  339.      */
  340.     public function setFirstname($firstname)
  341.     {
  342.         $this->firstname $firstname;
  343.         return $this;
  344.     }
  345.     /**
  346.      * Get firstname
  347.      *
  348.      * @return string
  349.      */
  350.     public function getFirstname()
  351.     {
  352.         return $this->firstname;
  353.     }
  354.     /**
  355.      * Set firstLogin
  356.      *
  357.      * @param integer $firstLogin
  358.      *
  359.      * @return User
  360.      */
  361.     public function setFirstLogin($firstLogin)
  362.     {
  363.         $this->firstLogin $firstLogin;
  364.         return $this;
  365.     }
  366.     /**
  367.      * Get firstLogin
  368.      *
  369.      * @return integer
  370.      */
  371.     public function getFirstLogin()
  372.     {
  373.         return $this->firstLogin;
  374.     }
  375.     /**
  376.      * Set profilePicture
  377.      *
  378.      * @param string $profilePicture
  379.      *
  380.      * @return User
  381.      */
  382.     public function setProfilePicture($profilePicture)
  383.     {
  384.         $this->profilePicture $profilePicture;
  385.         return $this;
  386.     }
  387.     /**
  388.      * Get profilePicture
  389.      *
  390.      * @return string
  391.      */
  392.     public function getProfilePicture()
  393.     {
  394.         return $this->profilePicture;
  395.     }
  396.     /**
  397.      * Set fbToken
  398.      *
  399.      * @param string $fbToken
  400.      *
  401.      * @return User
  402.      */
  403.     public function setFbToken($fbToken)
  404.     {
  405.         $this->fbToken $fbToken;
  406.         return $this;
  407.     }
  408.     /**
  409.      * Get fbToken
  410.      *
  411.      * @return string
  412.      */
  413.     public function getFbToken()
  414.     {
  415.         return $this->fbToken;
  416.     }
  417.     /**
  418.      * Set fbName
  419.      *
  420.      * @param string $fbName
  421.      *
  422.      * @return User
  423.      */
  424.     public function setFbName($fbName)
  425.     {
  426.         $this->fbName $fbName;
  427.         return $this;
  428.     }
  429.     /**
  430.      * Get fbName
  431.      *
  432.      * @return string
  433.      */
  434.     public function getFbName()
  435.     {
  436.         return $this->fbName;
  437.     }
  438.     /**
  439.      * Set fbId
  440.      *
  441.      * @param string $fbId
  442.      *
  443.      * @return User
  444.      */
  445.     public function setFbId($fbId)
  446.     {
  447.         $this->fbId $fbId;
  448.         return $this;
  449.     }
  450.     /**
  451.      * Get fbId
  452.      *
  453.      * @return string
  454.      */
  455.     public function getFbId()
  456.     {
  457.         return $this->fbId;
  458.     }
  459.     /**
  460.      * Set surname
  461.      *
  462.      * @param string $surname
  463.      *
  464.      * @return User
  465.      */
  466.     public function setSurname($surname)
  467.     {
  468.         $this->surname $surname;
  469.         return $this;
  470.     }
  471.     /**
  472.      * Get surname
  473.      *
  474.      * @return string
  475.      */
  476.     public function getSurname()
  477.     {
  478.         return $this->surname;
  479.     }
  480.     /**
  481.      * Add comment
  482.      *
  483.      * @param \App\Entity\ProductComment $comment
  484.      *
  485.      * @return User
  486.      */
  487.     public function addComment(\App\Entity\ProductComment $comment)
  488.     {
  489.         $this->comments[] = $comment;
  490.         return $this;
  491.     }
  492.     /**
  493.      * Remove comment
  494.      *
  495.      * @param \App\Entity\ProductComment $comment
  496.      */
  497.     public function removeComment(\App\Entity\ProductComment $comment)
  498.     {
  499.         $this->comments->removeElement($comment);
  500.     }
  501.     /**
  502.      * Get comments
  503.      *
  504.      * @return \Doctrine\Common\Collections\Collection
  505.      */
  506.     public function getComments()
  507.     {
  508.         return $this->comments;
  509.     }
  510.     /**
  511.      * Add notification
  512.      *
  513.      * @param \App\Entity\Notification $notification
  514.      *
  515.      * @return User
  516.      */
  517.     public function addNotification(\App\Entity\Notification $notification)
  518.     {
  519.         $this->notifications[] = $notification;
  520.         return $this;
  521.     }
  522.     /**
  523.      * Remove notification
  524.      *
  525.      * @param \App\Entity\Notification $notification
  526.      */
  527.     public function removeNotification(\App\Entity\Notification $notification)
  528.     {
  529.         $this->notifications->removeElement($notification);
  530.     }
  531.     /**
  532.      * Get notifications
  533.      *
  534.      * @return \Doctrine\Common\Collections\Collection
  535.      */
  536.     public function getNotifications()
  537.     {
  538.         return $this->notifications;
  539.     }
  540.     /**
  541.      * Set address
  542.      *
  543.      * @param \App\Entity\Address $address
  544.      *
  545.      * @return User
  546.      */
  547.     public function setAddress(\App\Entity\Address $address null)
  548.     {
  549.         $this->address $address;
  550.         return $this;
  551.     }
  552.     /**
  553.      * Get address
  554.      *
  555.      * @return \App\Entity\Address
  556.      */
  557.     public function getAddress()
  558.     {
  559.         return $this->address;
  560.     }
  561.     /**
  562.      * Set language
  563.      *
  564.      * @param \App\Entity\Language $language
  565.      *
  566.      * @return User
  567.      */
  568.     public function setLanguage(\App\Entity\Language $language null)
  569.     {
  570.         $this->language $language;
  571.         return $this;
  572.     }
  573.     /**
  574.      * Get language
  575.      *
  576.      * @return \App\Entity\Language
  577.      */
  578.     public function getLanguage()
  579.     {
  580.         return $this->language;
  581.     }
  582.     /**
  583.      * Set phone
  584.      *
  585.      * @param string $phone
  586.      *
  587.      * @return User
  588.      */
  589.     public function setPhone($phone)
  590.     {
  591.         $this->phone $phone;
  592.         return $this;
  593.     }
  594.     /**
  595.      * Get phone
  596.      *
  597.      * @return string
  598.      */
  599.     public function getPhone()
  600.     {
  601.         return $this->phone;
  602.     }
  603.     /**
  604.      * Set differentInvoiceAddress
  605.      *
  606.      * @param boolean $differentInvoiceAddress
  607.      *
  608.      * @return User
  609.      */
  610.     public function setDifferentInvoiceAddress($differentInvoiceAddress)
  611.     {
  612.         $this->differentInvoiceAddress $differentInvoiceAddress;
  613.         return $this;
  614.     }
  615.     /**
  616.      * Get differentInvoiceAddress
  617.      *
  618.      * @return boolean
  619.      */
  620.     public function getDifferentInvoiceAddress()
  621.     {
  622.         return $this->differentInvoiceAddress;
  623.     }
  624.     /**
  625.      * Set invoiceAddress
  626.      *
  627.      * @param \App\Entity\Address $invoiceAddress
  628.      *
  629.      * @return User
  630.      */
  631.     public function setInvoiceAddress(\App\Entity\Address $invoiceAddress null)
  632.     {
  633.         $this->invoiceAddress $invoiceAddress;
  634.         return $this;
  635.     }
  636.     /**
  637.      * Get invoiceAddress
  638.      *
  639.      * @return \App\Entity\Address
  640.      */
  641.     public function getInvoiceAddress()
  642.     {
  643.         return $this->invoiceAddress;
  644.     }
  645.     /**
  646.      * Set differentDeliveryAddress
  647.      *
  648.      * @param boolean $differentDeliveryAddress
  649.      *
  650.      * @return User
  651.      */
  652.     public function setDifferentDeliveryAddress($differentDeliveryAddress)
  653.     {
  654.         $this->differentDeliveryAddress $differentDeliveryAddress;
  655.         return $this;
  656.     }
  657.     /**
  658.      * Get differentDeliveryAddress
  659.      *
  660.      * @return boolean
  661.      */
  662.     public function getDifferentDeliveryAddress()
  663.     {
  664.         return $this->differentDeliveryAddress;
  665.     }
  666.     /**
  667.      * Set street
  668.      *
  669.      * @param string $street
  670.      *
  671.      * @return User
  672.      */
  673.     public function setStreet($street)
  674.     {
  675.         $this->street $street;
  676.         return $this;
  677.     }
  678.     /**
  679.      * Get street
  680.      *
  681.      * @return string
  682.      */
  683.     public function getStreet()
  684.     {
  685.         return $this->street;
  686.     }
  687.     /**
  688.      * Set citycode
  689.      *
  690.      * @param string $citycode
  691.      *
  692.      * @return User
  693.      */
  694.     public function setCitycode($citycode)
  695.     {
  696.         $this->citycode $citycode;
  697.         return $this;
  698.     }
  699.     /**
  700.      * Get citycode
  701.      *
  702.      * @return string
  703.      */
  704.     public function getCitycode()
  705.     {
  706.         return $this->citycode;
  707.     }
  708.     /**
  709.      * Set city
  710.      *
  711.      * @param string $city
  712.      *
  713.      * @return User
  714.      */
  715.     public function setCity($city)
  716.     {
  717.         $this->city $city;
  718.         return $this;
  719.     }
  720.     /**
  721.      * Get city
  722.      *
  723.      * @return string
  724.      */
  725.     public function getCity()
  726.     {
  727.         return $this->city;
  728.     }
  729.     /**
  730.      * Set country
  731.      *
  732.      * @param \App\Entity\Country $country
  733.      *
  734.      * @return User
  735.      */
  736.     public function setCountry(\App\Entity\Country $country null)
  737.     {
  738.         $this->country $country;
  739.         return $this;
  740.     }
  741.     /**
  742.      * Get country
  743.      *
  744.      * @return \App\Entity\Country
  745.      */
  746.     public function getCountry()
  747.     {
  748.         return $this->country;
  749.     }
  750.     /**
  751.      * Set streetHousenum
  752.      *
  753.      * @param string $streetHousenum
  754.      *
  755.      * @return User
  756.      */
  757.     public function setStreetHousenum($streetHousenum)
  758.     {
  759.         $this->streetHousenum $streetHousenum;
  760.         return $this;
  761.     }
  762.     /**
  763.      * Get streetHousenum
  764.      *
  765.      * @return string
  766.      */
  767.     public function getStreetHousenum()
  768.     {
  769.         return $this->streetHousenum;
  770.     }
  771.     /**
  772.      * Set termConditionAgree
  773.      *
  774.      * @param boolean $termConditionAgree
  775.      *
  776.      * @return User
  777.      */
  778.     public function setTermConditionAgree($termConditionAgree)
  779.     {
  780.         $this->termConditionAgree $termConditionAgree;
  781.         return $this;
  782.     }
  783.     /**
  784.      * Get termConditionAgree
  785.      *
  786.      * @return boolean
  787.      */
  788.     public function getTermConditionAgree()
  789.     {
  790.         return $this->termConditionAgree;
  791.     }
  792.     /**
  793.      * Set opinionAgree
  794.      *
  795.      * @param boolean $opinionAgree
  796.      *
  797.      * @return User
  798.      */
  799.     public function setOpinionAgree($opinionAgree)
  800.     {
  801.         $this->opinionAgree $opinionAgree;
  802.         return $this;
  803.     }
  804.     /**
  805.      * Get opinionAgree
  806.      *
  807.      * @return boolean
  808.      */
  809.     public function getOpinionAgree()
  810.     {
  811.         return $this->opinionAgree;
  812.     }
  813.     /**
  814.      * Set marketingAgree
  815.      *
  816.      * @param boolean $marketingAgree
  817.      *
  818.      * @return User
  819.      */
  820.     public function setMarketingAgree($marketingAgree)
  821.     {
  822.         $this->marketingAgree $marketingAgree;
  823.         return $this;
  824.     }
  825.     /**
  826.      * Get marketingAgree
  827.      *
  828.      * @return boolean
  829.      */
  830.     public function getMarketingAgree()
  831.     {
  832.         return $this->marketingAgree;
  833.     }
  834.     /**
  835.      * Set agreeAllSelect
  836.      *
  837.      * @param boolean $agreeAllSelect
  838.      *
  839.      * @return User
  840.      */
  841.     public function setAgreeAllSelect($agreeAllSelect)
  842.     {
  843.         $this->agreeAllSelect $agreeAllSelect;
  844.         return $this;
  845.     }
  846.     /**
  847.      * Get agreeAllSelect
  848.      *
  849.      * @return boolean
  850.      */
  851.     public function getAgreeAllSelect()
  852.     {
  853.         return $this->agreeAllSelect;
  854.     }
  855.     /**
  856.      * Get enabled
  857.      *
  858.      * @return boolean
  859.      */
  860.     public function getEnabled()
  861.     {
  862.         return $this->enabled;
  863.     }
  864.     /**
  865.      * Set registered
  866.      *
  867.      * @param boolean $registered
  868.      *
  869.      * @return User
  870.      */
  871.     public function setRegistered($registered)
  872.     {
  873.         $this->registered $registered;
  874.         return $this;
  875.     }
  876.     /**
  877.      * Get registered
  878.      *
  879.      * @return boolean
  880.      */
  881.     public function getRegistered()
  882.     {
  883.         return $this->registered;
  884.     }
  885.     public function getId(): ?int
  886.     {
  887.         return $this->id;
  888.     }
  889.     public function getType(): ?bool
  890.     {
  891.         return $this->type;
  892.     }
  893.     public function setType(?bool $type): self
  894.     {
  895.         $this->type $type;
  896.         return $this;
  897.     }
  898.     public function getUserGroup(): ?UserGroup
  899.     {
  900.         return $this->userGroup;
  901.     }
  902.     public function setUserGroup(?UserGroup $userGroup): self
  903.     {
  904.         $this->userGroup $userGroup;
  905.         return $this;
  906.     }
  907.     public function getManageLanguagesIds() {
  908.         $ids = [];
  909.         foreach ($this->getManageLanguages() as $manageLanguage) {
  910.             $ids[] = $manageLanguage->getId();
  911.         }
  912.         return $ids;
  913.     }
  914.     public function getManageLanguagesLocales() {
  915.         $ids = [];
  916.         foreach ($this->getManageLanguages() as $manageLanguage) {
  917.             $ids[] = $manageLanguage->getLocale();
  918.         }
  919.         return $ids;
  920.     }
  921.     /**
  922.      * @return Collection|Language[]
  923.      */
  924.     public function getManageLanguages(): Collection
  925.     {
  926.         return $this->manageLanguages;
  927.     }
  928.     public function addManageLanguage(Language $manageLanguage): self
  929.     {
  930.         if (!$this->manageLanguages->contains($manageLanguage)) {
  931.             $this->manageLanguages[] = $manageLanguage;
  932.         }
  933.         return $this;
  934.     }
  935.     public function removeManageLanguage(Language $manageLanguage): self
  936.     {
  937.         if ($this->manageLanguages->contains($manageLanguage)) {
  938.             $this->manageLanguages->removeElement($manageLanguage);
  939.         }
  940.         return $this;
  941.     }
  942.     /**
  943.      * Set roJudet
  944.      *
  945.      * @param \App\Entity\RoJudet $roJudet
  946.      *
  947.      * @return User
  948.      */
  949.     public function setRoJudet(\App\Entity\RoJudet $roJudet null)
  950.     {
  951.         $this->roJudet $roJudet;
  952.         return $this;
  953.     }
  954.     /**
  955.      * Get roJudet
  956.      *
  957.      * @return \App\Entity\RoJudet
  958.      */
  959.     public function getRoJudet()
  960.     {
  961.         return $this->roJudet;
  962.     }
  963.     /**
  964.      * @return mixed
  965.      */
  966.     public function getPasswordChangedAt()
  967.     {
  968.         return $this->passwordChangedAt;
  969.     }
  970.     /**
  971.      * @param mixed $passwordChangedAt
  972.      */
  973.     public function setPasswordChangedAt($passwordChangedAt)
  974.     {
  975.         $this->passwordChangedAt $passwordChangedAt;
  976.     }
  977.     public function getConsentFeedback(): ?bool
  978.     {
  979.         return $this->consentFeedback;
  980.     }
  981.     public function getDefaultAddress(): ?Address
  982.     {
  983.         return $this->defaultAddress;
  984.     }
  985.     public function setDefaultAddress(?Address $defaultAddress): self
  986.     {
  987.         $this->defaultAddress $defaultAddress;
  988.         return $this;
  989.     }
  990.     public function getDefaultInvoiceAddress(): ?Address
  991.     {
  992.         return $this->defaultInvoiceAddress;
  993.     }
  994.     public function setDefaultInvoiceAddress(?Address $defaultInvoiceAddress): self
  995.     {
  996.         $this->defaultInvoiceAddress $defaultInvoiceAddress;
  997.         return $this;
  998.     }
  999.     /**
  1000.      * @return mixed
  1001.      */
  1002.     public function getConfirmationEmailAt()
  1003.     {
  1004.         return $this->confirmationEmailAt;
  1005.     }
  1006.     /**
  1007.      * @param mixed $confirmationEmailAt
  1008.      */
  1009.     public function setConfirmationEmailAt($confirmationEmailAt)
  1010.     {
  1011.         $this->confirmationEmailAt $confirmationEmailAt;
  1012.     }
  1013.     /**
  1014.      * @return bool
  1015.      */
  1016.     public function isConfirmed()
  1017.     {
  1018.         return $this->confirmed;
  1019.     }
  1020.     /**
  1021.      * @param bool $confirmed
  1022.      */
  1023.     public function setConfirmed($confirmed)
  1024.     {
  1025.         $this->confirmed $confirmed;
  1026.     }
  1027.     /**
  1028.      * @return string
  1029.      */
  1030.     public function getRegisterConfirmationToken()
  1031.     {
  1032.         return $this->registerConfirmationToken;
  1033.     }
  1034.     /**
  1035.      * @param string $registerConfirmationToken
  1036.      */
  1037.     public function setRegisterConfirmationToken($registerConfirmationToken)
  1038.     {
  1039.         $this->registerConfirmationToken $registerConfirmationToken;
  1040.     }
  1041.     public function getConfirmed(): ?bool
  1042.     {
  1043.         return $this->confirmed;
  1044.     }
  1045.     /**
  1046.      * @return Collection|Order[]
  1047.      */
  1048.     public function getOrders(): Collection
  1049.     {
  1050.         return $this->orders;
  1051.     }
  1052.     public function addOrder(Order $order): self
  1053.     {
  1054.         if (!$this->orders->contains($order)) {
  1055.             $this->orders[] = $order;
  1056.             $order->setUser($this);
  1057.         }
  1058.         return $this;
  1059.     }
  1060.     public function removeOrder(Order $order): self
  1061.     {
  1062.         if ($this->orders->removeElement($order)) {
  1063.             // set the owning side to null (unless already changed)
  1064.             if ($order->getUser() === $this) {
  1065.                 $order->setUser(null);
  1066.             }
  1067.         }
  1068.         return $this;
  1069.     }
  1070.     public function ordersCount() {
  1071.         $c 0;
  1072.         /** @var $order Order */
  1073.         foreach ($this->getOrders() as $order) {
  1074.             if ($order->getStatus() && $order->getStatus()->getId() != 1) {
  1075.                 $c $c 1;
  1076.             }
  1077.         }
  1078.         return $c;
  1079.     }
  1080.     public function ordersValue() {
  1081.         $c 0;
  1082.         /** @var $order Order */
  1083.         foreach ($this->getOrders() as $order) {
  1084.             if ($order->getStatus() && $order->getStatus()->getId() != 1) {
  1085.                 $c $c $order->getTotalCostBrutto();
  1086.             }
  1087.         }
  1088.         return $c;
  1089.     }
  1090. }