app/proxy/entity/src/Eccube/Entity/Customer.php line 32

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of EC-CUBE
  4.  *
  5.  * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  6.  *
  7.  * http://www.ec-cube.co.jp/
  8.  *
  9.  * For the full copyright and license information, please view the LICENSE
  10.  * file that was distributed with this source code.
  11.  */
  12. namespace Eccube\Entity;
  13. use Doctrine\ORM\Mapping as ORM;
  14. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  15. use Symfony\Component\Security\Core\User\UserInterface;
  16. use Symfony\Component\Validator\Constraints as Assert;
  17. use Symfony\Component\Validator\Mapping\ClassMetadata;
  18.     /**
  19.      * Customer
  20.      *
  21.      * @ORM\Table(name="dtb_customer", uniqueConstraints={@ORM\UniqueConstraint(name="secret_key", columns={"secret_key"})}, indexes={@ORM\Index(name="dtb_customer_buy_times_idx", columns={"buy_times"}), @ORM\Index(name="dtb_customer_buy_total_idx", columns={"buy_total"}), @ORM\Index(name="dtb_customer_create_date_idx", columns={"create_date"}), @ORM\Index(name="dtb_customer_update_date_idx", columns={"update_date"}), @ORM\Index(name="dtb_customer_last_buy_date_idx", columns={"last_buy_date"}), @ORM\Index(name="dtb_customer_email_idx", columns={"email"})})
  22.      * @ORM\InheritanceType("SINGLE_TABLE")
  23.      * @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
  24.      * @ORM\HasLifecycleCallbacks()
  25.      * @ORM\Entity(repositoryClass="Eccube\Repository\CustomerRepository")
  26.      */
  27.     class Customer extends \Eccube\Entity\AbstractEntity implements UserInterface\Serializable
  28.     {
  29.     use \Plugin\CustomerRank42\Entity\CustomerTrait;
  30.         /**
  31.          * @var int
  32.          *
  33.          * @ORM\Column(name="id", type="integer", options={"unsigned":true})
  34.          * @ORM\Id
  35.          * @ORM\GeneratedValue(strategy="IDENTITY")
  36.          */
  37.         private $id;
  38.         /**
  39.          * @var string
  40.          *
  41.          * @ORM\Column(name="name01", type="string", length=255)
  42.          */
  43.         private $name01;
  44.         /**
  45.          * @var string
  46.          *
  47.          * @ORM\Column(name="name02", type="string", length=255)
  48.          */
  49.         private $name02;
  50.         /**
  51.          * @var string|null
  52.          *
  53.          * @ORM\Column(name="kana01", type="string", length=255, nullable=true)
  54.          */
  55.         private $kana01;
  56.         /**
  57.          * @var string|null
  58.          *
  59.          * @ORM\Column(name="kana02", type="string", length=255, nullable=true)
  60.          */
  61.         private $kana02;
  62.         /**
  63.          * @var string|null
  64.          *
  65.          * @ORM\Column(name="company_name", type="string", length=255, nullable=true)
  66.          */
  67.         private $company_name;
  68.         /**
  69.          * @var string|null
  70.          *
  71.          * @ORM\Column(name="postal_code", type="string", length=8, nullable=true)
  72.          */
  73.         private $postal_code;
  74.         /**
  75.          * @var string|null
  76.          *
  77.          * @ORM\Column(name="addr01", type="string", length=255, nullable=true)
  78.          */
  79.         private $addr01;
  80.         /**
  81.          * @var string|null
  82.          *
  83.          * @ORM\Column(name="addr02", type="string", length=255, nullable=true)
  84.          */
  85.         private $addr02;
  86.         /**
  87.          * @var string
  88.          *
  89.          * @ORM\Column(name="email", type="string", length=255)
  90.          */
  91.         private $email;
  92.         /**
  93.          * @var string|null
  94.          *
  95.          * @ORM\Column(name="phone_number", type="string", length=14, nullable=true)
  96.          */
  97.         private $phone_number;
  98.         /**
  99.          * @var \DateTime|null
  100.          *
  101.          * @ORM\Column(name="birth", type="datetimetz", nullable=true)
  102.          */
  103.         private $birth;
  104.         /**
  105.          * @Assert\NotBlank()
  106.          * @Assert\Length(max=4096)
  107.          */
  108.         private $plain_password;
  109.         /**
  110.          * @var string|null
  111.          *
  112.          * @ORM\Column(name="password", type="string", length=255)
  113.          */
  114.         private $password;
  115.         /**
  116.          * @var string|null
  117.          *
  118.          * @ORM\Column(name="salt", type="string", length=255, nullable=true)
  119.          */
  120.         private $salt;
  121.         /**
  122.          * @var string
  123.          *
  124.          * @ORM\Column(name="secret_key", type="string", length=255)
  125.          */
  126.         private $secret_key;
  127.         /**
  128.          * @var \DateTime|null
  129.          *
  130.          * @ORM\Column(name="first_buy_date", type="datetimetz", nullable=true)
  131.          */
  132.         private $first_buy_date;
  133.         /**
  134.          * @var \DateTime|null
  135.          *
  136.          * @ORM\Column(name="last_buy_date", type="datetimetz", nullable=true)
  137.          */
  138.         private $last_buy_date;
  139.         /**
  140.          * @var string|null
  141.          *
  142.          * @ORM\Column(name="buy_times", type="decimal", precision=10, scale=0, nullable=true, options={"unsigned":true,"default":0})
  143.          */
  144.         private $buy_times 0;
  145.         /**
  146.          * @var string|null
  147.          *
  148.          * @ORM\Column(name="buy_total", type="decimal", precision=12, scale=2, nullable=true, options={"unsigned":true,"default":0})
  149.          */
  150.         private $buy_total 0;
  151.         /**
  152.          * @var string|null
  153.          *
  154.          * @ORM\Column(name="note", type="string", length=4000, nullable=true)
  155.          */
  156.         private $note;
  157.         /**
  158.          * @var string|null
  159.          *
  160.          * @ORM\Column(name="reset_key", type="string", length=255, nullable=true)
  161.          */
  162.         private $reset_key;
  163.         /**
  164.          * @var \DateTime|null
  165.          *
  166.          * @ORM\Column(name="reset_expire", type="datetimetz", nullable=true)
  167.          */
  168.         private $reset_expire;
  169.         /**
  170.          * @var string|null
  171.          *
  172.          * @ORM\Column(name="customer_code", type="string", length=255, nullable=true)
  173.          */
  174.         private $customer_code;
  175.         
  176.         /**
  177.          * @var string
  178.          *
  179.          * @ORM\Column(name="point", type="decimal", precision=12, scale=0, options={"unsigned":false,"default":0})
  180.          */
  181.         private $point '0';
  182.         /**
  183.          * @var \DateTime
  184.          *
  185.          * @ORM\Column(name="create_date", type="datetimetz")
  186.          */
  187.         private $create_date;
  188.         /**
  189.          * @var \DateTime
  190.          *
  191.          * @ORM\Column(name="update_date", type="datetimetz")
  192.          */
  193.         private $update_date;
  194.         /**
  195.          * @var \Doctrine\Common\Collections\Collection
  196.          *
  197.          * @ORM\OneToMany(targetEntity="Eccube\Entity\CustomerFavoriteProduct", mappedBy="Customer", cascade={"remove"})
  198.          */
  199.         private $CustomerFavoriteProducts;
  200.         /**
  201.          * @var \Doctrine\Common\Collections\Collection
  202.          *
  203.          * @ORM\OneToMany(targetEntity="Eccube\Entity\CustomerAddress", mappedBy="Customer", cascade={"remove"})
  204.          * @ORM\OrderBy({
  205.          *     "id"="ASC"
  206.          * })
  207.          */
  208.         private $CustomerAddresses;
  209.         /**
  210.          * @var \Doctrine\Common\Collections\Collection
  211.          *
  212.          * @ORM\OneToMany(targetEntity="Eccube\Entity\Order", mappedBy="Customer")
  213.          */
  214.         private $Orders;
  215.         /**
  216.          * @var \Eccube\Entity\Master\CustomerStatus
  217.          *
  218.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\CustomerStatus")
  219.          * @ORM\JoinColumns({
  220.          *   @ORM\JoinColumn(name="customer_status_id", referencedColumnName="id")
  221.          * })
  222.          */
  223.         private $Status;
  224.         /**
  225.          * @var \Eccube\Entity\Master\Sex
  226.          *
  227.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\Sex")
  228.          * @ORM\JoinColumns({
  229.          *   @ORM\JoinColumn(name="sex_id", referencedColumnName="id")
  230.          * })
  231.          */
  232.         private $Sex;
  233.         /**
  234.          * @var \Eccube\Entity\Master\Job
  235.          *
  236.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\Job")
  237.          * @ORM\JoinColumns({
  238.          *   @ORM\JoinColumn(name="job_id", referencedColumnName="id")
  239.          * })
  240.          */
  241.         private $Job;
  242.         /**
  243.          * @var \Eccube\Entity\Master\Country
  244.          *
  245.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\Country")
  246.          * @ORM\JoinColumns({
  247.          *   @ORM\JoinColumn(name="country_id", referencedColumnName="id")
  248.          * })
  249.          */
  250.         private $Country;
  251.         /**
  252.          * @var \Eccube\Entity\Master\Pref
  253.          *
  254.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\Pref")
  255.          * @ORM\JoinColumns({
  256.          *   @ORM\JoinColumn(name="pref_id", referencedColumnName="id")
  257.          * })
  258.          */
  259.         private $Pref;
  260.         /**
  261.          * Constructor
  262.          */
  263.         public function __construct()
  264.         {
  265.             $this->CustomerFavoriteProducts = new \Doctrine\Common\Collections\ArrayCollection();
  266.             $this->CustomerAddresses = new \Doctrine\Common\Collections\ArrayCollection();
  267.             $this->Orders = new \Doctrine\Common\Collections\ArrayCollection();
  268.             $this->setBuyTimes(0);
  269.             $this->setBuyTotal(0);
  270.         }
  271.         /**
  272.          * @return string
  273.          */
  274.         public function __toString()
  275.         {
  276.             return (string) ($this->getName01().' '.$this->getName02());
  277.         }
  278.         /**
  279.          * {@inheritdoc}
  280.          */
  281.         public function getRoles()
  282.         {
  283.             return ['ROLE_USER'];
  284.         }
  285.         /**
  286.          * {@inheritdoc}
  287.          */
  288.         public function getUsername()
  289.         {
  290.             return $this->email;
  291.         }
  292.         /**
  293.          * {@inheritdoc}
  294.          */
  295.         public function eraseCredentials()
  296.         {
  297.         }
  298.         // TODO: できればFormTypeで行いたい
  299.         public static function loadValidatorMetadata(ClassMetadata $metadata)
  300.         {
  301.             $metadata->addConstraint(new UniqueEntity([
  302.                 'fields' => 'email',
  303.                 'message' => 'form_error.customer_already_exists',
  304.                 'repositoryMethod' => 'getNonWithdrawingCustomers',
  305.             ]));
  306.         }
  307.         /**
  308.          * Get id.
  309.          *
  310.          * @return int
  311.          */
  312.         public function getId()
  313.         {
  314.             return $this->id;
  315.         }
  316.         /**
  317.          * Set name01.
  318.          *
  319.          * @param string $name01
  320.          *
  321.          * @return Customer
  322.          */
  323.         public function setName01($name01)
  324.         {
  325.             $this->name01 $name01;
  326.             return $this;
  327.         }
  328.         /**
  329.          * Get name01.
  330.          *
  331.          * @return string
  332.          */
  333.         public function getName01()
  334.         {
  335.             return $this->name01;
  336.         }
  337.         /**
  338.          * Set name02.
  339.          *
  340.          * @param string $name02
  341.          *
  342.          * @return Customer
  343.          */
  344.         public function setName02($name02)
  345.         {
  346.             $this->name02 $name02;
  347.             return $this;
  348.         }
  349.         /**
  350.          * Get name02.
  351.          *
  352.          * @return string
  353.          */
  354.         public function getName02()
  355.         {
  356.             return $this->name02;
  357.         }
  358.         /**
  359.          * Set kana01.
  360.          *
  361.          * @param string|null $kana01
  362.          *
  363.          * @return Customer
  364.          */
  365.         public function setKana01($kana01 null)
  366.         {
  367.             $this->kana01 $kana01;
  368.             return $this;
  369.         }
  370.         /**
  371.          * Get kana01.
  372.          *
  373.          * @return string|null
  374.          */
  375.         public function getKana01()
  376.         {
  377.             return $this->kana01;
  378.         }
  379.         /**
  380.          * Set kana02.
  381.          *
  382.          * @param string|null $kana02
  383.          *
  384.          * @return Customer
  385.          */
  386.         public function setKana02($kana02 null)
  387.         {
  388.             $this->kana02 $kana02;
  389.             return $this;
  390.         }
  391.         /**
  392.          * Get kana02.
  393.          *
  394.          * @return string|null
  395.          */
  396.         public function getKana02()
  397.         {
  398.             return $this->kana02;
  399.         }
  400.         /**
  401.          * Set companyName.
  402.          *
  403.          * @param string|null $companyName
  404.          *
  405.          * @return Customer
  406.          */
  407.         public function setCompanyName($companyName null)
  408.         {
  409.             $this->company_name $companyName;
  410.             return $this;
  411.         }
  412.         /**
  413.          * Get companyName.
  414.          *
  415.          * @return string|null
  416.          */
  417.         public function getCompanyName()
  418.         {
  419.             return $this->company_name;
  420.         }
  421.         /**
  422.          * Set postal_code.
  423.          *
  424.          * @param string|null $postal_code
  425.          *
  426.          * @return Customer
  427.          */
  428.         public function setPostalCode($postal_code null)
  429.         {
  430.             $this->postal_code $postal_code;
  431.             return $this;
  432.         }
  433.         /**
  434.          * Get postal_code.
  435.          *
  436.          * @return string|null
  437.          */
  438.         public function getPostalCode()
  439.         {
  440.             return $this->postal_code;
  441.         }
  442.         /**
  443.          * Set addr01.
  444.          *
  445.          * @param string|null $addr01
  446.          *
  447.          * @return Customer
  448.          */
  449.         public function setAddr01($addr01 null)
  450.         {
  451.             $this->addr01 $addr01;
  452.             return $this;
  453.         }
  454.         /**
  455.          * Get addr01.
  456.          *
  457.          * @return string|null
  458.          */
  459.         public function getAddr01()
  460.         {
  461.             return $this->addr01;
  462.         }
  463.         /**
  464.          * Set addr02.
  465.          *
  466.          * @param string|null $addr02
  467.          *
  468.          * @return Customer
  469.          */
  470.         public function setAddr02($addr02 null)
  471.         {
  472.             $this->addr02 $addr02;
  473.             return $this;
  474.         }
  475.         /**
  476.          * Get addr02.
  477.          *
  478.          * @return string|null
  479.          */
  480.         public function getAddr02()
  481.         {
  482.             return $this->addr02;
  483.         }
  484.         /**
  485.          * Set email.
  486.          *
  487.          * @param string $email
  488.          *
  489.          * @return Customer
  490.          */
  491.         public function setEmail($email)
  492.         {
  493.             $this->email $email;
  494.             return $this;
  495.         }
  496.         /**
  497.          * Get email.
  498.          *
  499.          * @return string
  500.          */
  501.         public function getEmail()
  502.         {
  503.             return $this->email;
  504.         }
  505.         /**
  506.          * Set phone_number.
  507.          *
  508.          * @param string|null $phone_number
  509.          *
  510.          * @return Customer
  511.          */
  512.         public function setPhoneNumber($phone_number null)
  513.         {
  514.             $this->phone_number $phone_number;
  515.             return $this;
  516.         }
  517.         /**
  518.          * Get phone_number.
  519.          *
  520.          * @return string|null
  521.          */
  522.         public function getPhoneNumber()
  523.         {
  524.             return $this->phone_number;
  525.         }
  526.         /**
  527.          * Set birth.
  528.          *
  529.          * @param \DateTime|null $birth
  530.          *
  531.          * @return Customer
  532.          */
  533.         public function setBirth($birth null)
  534.         {
  535.             $this->birth $birth;
  536.             return $this;
  537.         }
  538.         /**
  539.          * Get birth.
  540.          *
  541.          * @return \DateTime|null
  542.          */
  543.         public function getBirth()
  544.         {
  545.             return $this->birth;
  546.         }
  547.         /**
  548.          * @param string|null $password
  549.          *
  550.          * @return $this
  551.          */
  552.         public function setPlainPassword(?string $password): self
  553.         {
  554.             $this->plain_password $password;
  555.             return $this;
  556.         }
  557.         /**
  558.          * @return string|null
  559.          */
  560.         public function getPlainPassword(): ?string
  561.         {
  562.             return $this->plain_password;
  563.         }
  564.         /**
  565.          * Set password.
  566.          *
  567.          * @param string|null $password
  568.          *
  569.          * @return Customer
  570.          */
  571.         public function setPassword($password null)
  572.         {
  573.             $this->password $password;
  574.             return $this;
  575.         }
  576.         /**
  577.          * Get password.
  578.          *
  579.          * @return string|null
  580.          */
  581.         public function getPassword()
  582.         {
  583.             return $this->password;
  584.         }
  585.         /**
  586.          * Set salt.
  587.          *
  588.          * @param string|null $salt
  589.          *
  590.          * @return Customer
  591.          */
  592.         public function setSalt($salt null)
  593.         {
  594.             $this->salt $salt;
  595.             return $this;
  596.         }
  597.         /**
  598.          * Get salt.
  599.          *
  600.          * @return string|null
  601.          */
  602.         public function getSalt()
  603.         {
  604.             return $this->salt;
  605.         }
  606.         /**
  607.          * Set secretKey.
  608.          *
  609.          * @param string $secretKey
  610.          *
  611.          * @return Customer
  612.          */
  613.         public function setSecretKey($secretKey)
  614.         {
  615.             $this->secret_key $secretKey;
  616.             return $this;
  617.         }
  618.         /**
  619.          * Get secretKey.
  620.          *
  621.          * @return string
  622.          */
  623.         public function getSecretKey()
  624.         {
  625.             return $this->secret_key;
  626.         }
  627.         /**
  628.          * Set firstBuyDate.
  629.          *
  630.          * @param \DateTime|null $firstBuyDate
  631.          *
  632.          * @return Customer
  633.          */
  634.         public function setFirstBuyDate($firstBuyDate null)
  635.         {
  636.             $this->first_buy_date $firstBuyDate;
  637.             return $this;
  638.         }
  639.         /**
  640.          * Get firstBuyDate.
  641.          *
  642.          * @return \DateTime|null
  643.          */
  644.         public function getFirstBuyDate()
  645.         {
  646.             return $this->first_buy_date;
  647.         }
  648.         /**
  649.          * Set lastBuyDate.
  650.          *
  651.          * @param \DateTime|null $lastBuyDate
  652.          *
  653.          * @return Customer
  654.          */
  655.         public function setLastBuyDate($lastBuyDate null)
  656.         {
  657.             $this->last_buy_date $lastBuyDate;
  658.             return $this;
  659.         }
  660.         /**
  661.          * Get lastBuyDate.
  662.          *
  663.          * @return \DateTime|null
  664.          */
  665.         public function getLastBuyDate()
  666.         {
  667.             return $this->last_buy_date;
  668.         }
  669.         /**
  670.          * Set buyTimes.
  671.          *
  672.          * @param string|null $buyTimes
  673.          *
  674.          * @return Customer
  675.          */
  676.         public function setBuyTimes($buyTimes null)
  677.         {
  678.             $this->buy_times $buyTimes;
  679.             return $this;
  680.         }
  681.         /**
  682.          * Get buyTimes.
  683.          *
  684.          * @return string|null
  685.          */
  686.         public function getBuyTimes()
  687.         {
  688.             return $this->buy_times;
  689.         }
  690.         /**
  691.          * Set buyTotal.
  692.          *
  693.          * @param string|null $buyTotal
  694.          *
  695.          * @return Customer
  696.          */
  697.         public function setBuyTotal($buyTotal null)
  698.         {
  699.             $this->buy_total $buyTotal;
  700.             return $this;
  701.         }
  702.         /**
  703.          * Get buyTotal.
  704.          *
  705.          * @return string|null
  706.          */
  707.         public function getBuyTotal()
  708.         {
  709.             return $this->buy_total;
  710.         }
  711.         /**
  712.          * Set note.
  713.          *
  714.          * @param string|null $note
  715.          *
  716.          * @return Customer
  717.          */
  718.         public function setNote($note null)
  719.         {
  720.             $this->note $note;
  721.             return $this;
  722.         }
  723.         /**
  724.          * Get note.
  725.          *
  726.          * @return string|null
  727.          */
  728.         public function getNote()
  729.         {
  730.             return $this->note;
  731.         }
  732.         /**
  733.          * Set resetKey.
  734.          *
  735.          * @param string|null $resetKey
  736.          *
  737.          * @return Customer
  738.          */
  739.         public function setResetKey($resetKey null)
  740.         {
  741.             $this->reset_key $resetKey;
  742.             return $this;
  743.         }
  744.         /**
  745.          * Get resetKey.
  746.          *
  747.          * @return string|null
  748.          */
  749.         public function getResetKey()
  750.         {
  751.             return $this->reset_key;
  752.         }
  753.         /**
  754.          * Set resetExpire.
  755.          *
  756.          * @param \DateTime|null $resetExpire
  757.          *
  758.          * @return Customer
  759.          */
  760.         public function setResetExpire($resetExpire null)
  761.         {
  762.             $this->reset_expire $resetExpire;
  763.             return $this;
  764.         }
  765.         /**
  766.          * Get resetExpire.
  767.          *
  768.          * @return \DateTime|null
  769.          */
  770.         public function getResetExpire()
  771.         {
  772.             return $this->reset_expire;
  773.         }
  774.         
  775.         /**
  776.          * Set customer_code.
  777.          *
  778.          * @param string|null $customer_code
  779.          * @return Customer
  780.          */
  781.         public function setCustomerCode($customer_code null)
  782.         {
  783.             $this->customer_code $customer_code;
  784.             return $this;
  785.         }
  786.         /**
  787.          * Get customer_code.
  788.          *
  789.          * @return string|null
  790.          */
  791.         public function getCustomerCode()
  792.         {
  793.             return $this->customer_code;
  794.         }
  795.         
  796.         /**
  797.          * Set createDate.
  798.          *
  799.          * @param \DateTime $createDate
  800.          *
  801.          * @return Customer
  802.          */
  803.         public function setCreateDate($createDate)
  804.         {
  805.             $this->create_date $createDate;
  806.             return $this;
  807.         }
  808.         /**
  809.          * Get createDate.
  810.          *
  811.          * @return \DateTime
  812.          */
  813.         public function getCreateDate()
  814.         {
  815.             return $this->create_date;
  816.         }
  817.         /**
  818.          * Set updateDate.
  819.          *
  820.          * @param \DateTime $updateDate
  821.          *
  822.          * @return Customer
  823.          */
  824.         public function setUpdateDate($updateDate)
  825.         {
  826.             $this->update_date $updateDate;
  827.             return $this;
  828.         }
  829.         /**
  830.          * Get updateDate.
  831.          *
  832.          * @return \DateTime
  833.          */
  834.         public function getUpdateDate()
  835.         {
  836.             return $this->update_date;
  837.         }
  838.         /**
  839.          * Add customerFavoriteProduct.
  840.          *
  841.          * @param \Eccube\Entity\CustomerFavoriteProduct $customerFavoriteProduct
  842.          *
  843.          * @return Customer
  844.          */
  845.         public function addCustomerFavoriteProduct(CustomerFavoriteProduct $customerFavoriteProduct)
  846.         {
  847.             $this->CustomerFavoriteProducts[] = $customerFavoriteProduct;
  848.             return $this;
  849.         }
  850.         /**
  851.          * Remove customerFavoriteProduct.
  852.          *
  853.          * @param \Eccube\Entity\CustomerFavoriteProduct $customerFavoriteProduct
  854.          *
  855.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  856.          */
  857.         public function removeCustomerFavoriteProduct(CustomerFavoriteProduct $customerFavoriteProduct)
  858.         {
  859.             return $this->CustomerFavoriteProducts->removeElement($customerFavoriteProduct);
  860.         }
  861.         /**
  862.          * Get customerFavoriteProducts.
  863.          *
  864.          * @return \Doctrine\Common\Collections\Collection
  865.          */
  866.         public function getCustomerFavoriteProducts()
  867.         {
  868.             return $this->CustomerFavoriteProducts;
  869.         }
  870.         /**
  871.          * Add customerAddress.
  872.          *
  873.          * @param \Eccube\Entity\CustomerAddress $customerAddress
  874.          *
  875.          * @return Customer
  876.          */
  877.         public function addCustomerAddress(CustomerAddress $customerAddress)
  878.         {
  879.             $this->CustomerAddresses[] = $customerAddress;
  880.             return $this;
  881.         }
  882.         /**
  883.          * Remove customerAddress.
  884.          *
  885.          * @param \Eccube\Entity\CustomerAddress $customerAddress
  886.          *
  887.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  888.          */
  889.         public function removeCustomerAddress(CustomerAddress $customerAddress)
  890.         {
  891.             return $this->CustomerAddresses->removeElement($customerAddress);
  892.         }
  893.         /**
  894.          * Get customerAddresses.
  895.          *
  896.          * @return \Doctrine\Common\Collections\Collection
  897.          */
  898.         public function getCustomerAddresses()
  899.         {
  900.             return $this->CustomerAddresses;
  901.         }
  902.         /**
  903.          * Add order.
  904.          *
  905.          * @param \Eccube\Entity\Order $order
  906.          *
  907.          * @return Customer
  908.          */
  909.         public function addOrder(Order $order)
  910.         {
  911.             $this->Orders[] = $order;
  912.             return $this;
  913.         }
  914.         /**
  915.          * Remove order.
  916.          *
  917.          * @param \Eccube\Entity\Order $order
  918.          *
  919.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  920.          */
  921.         public function removeOrder(Order $order)
  922.         {
  923.             return $this->Orders->removeElement($order);
  924.         }
  925.         /**
  926.          * Get orders.
  927.          *
  928.          * @return \Doctrine\Common\Collections\Collection
  929.          */
  930.         public function getOrders()
  931.         {
  932.             return $this->Orders;
  933.         }
  934.         /**
  935.          * Set status.
  936.          *
  937.          * @param \Eccube\Entity\Master\CustomerStatus|null $status
  938.          *
  939.          * @return Customer
  940.          */
  941.         public function setStatus(Master\CustomerStatus $status null)
  942.         {
  943.             $this->Status $status;
  944.             return $this;
  945.         }
  946.         /**
  947.          * Get status.
  948.          *
  949.          * @return \Eccube\Entity\Master\CustomerStatus|null
  950.          */
  951.         public function getStatus()
  952.         {
  953.             return $this->Status;
  954.         }
  955.         /**
  956.          * Set sex.
  957.          *
  958.          * @param \Eccube\Entity\Master\Sex|null $sex
  959.          *
  960.          * @return Customer
  961.          */
  962.         public function setSex(Master\Sex $sex null)
  963.         {
  964.             $this->Sex $sex;
  965.             return $this;
  966.         }
  967.         /**
  968.          * Get sex.
  969.          *
  970.          * @return \Eccube\Entity\Master\Sex|null
  971.          */
  972.         public function getSex()
  973.         {
  974.             return $this->Sex;
  975.         }
  976.         /**
  977.          * Set job.
  978.          *
  979.          * @param \Eccube\Entity\Master\Job|null $job
  980.          *
  981.          * @return Customer
  982.          */
  983.         public function setJob(Master\Job $job null)
  984.         {
  985.             $this->Job $job;
  986.             return $this;
  987.         }
  988.         /**
  989.          * Get job.
  990.          *
  991.          * @return \Eccube\Entity\Master\Job|null
  992.          */
  993.         public function getJob()
  994.         {
  995.             return $this->Job;
  996.         }
  997.         /**
  998.          * Set country.
  999.          *
  1000.          * @param \Eccube\Entity\Master\Country|null $country
  1001.          *
  1002.          * @return Customer
  1003.          */
  1004.         public function setCountry(Master\Country $country null)
  1005.         {
  1006.             $this->Country $country;
  1007.             return $this;
  1008.         }
  1009.         /**
  1010.          * Get country.
  1011.          *
  1012.          * @return \Eccube\Entity\Master\Country|null
  1013.          */
  1014.         public function getCountry()
  1015.         {
  1016.             return $this->Country;
  1017.         }
  1018.         /**
  1019.          * Set pref.
  1020.          *
  1021.          * @param \Eccube\Entity\Master\Pref|null $pref
  1022.          *
  1023.          * @return Customer
  1024.          */
  1025.         public function setPref(Master\Pref $pref null)
  1026.         {
  1027.             $this->Pref $pref;
  1028.             return $this;
  1029.         }
  1030.         /**
  1031.          * Get pref.
  1032.          *
  1033.          * @return \Eccube\Entity\Master\Pref|null
  1034.          */
  1035.         public function getPref()
  1036.         {
  1037.             return $this->Pref;
  1038.         }
  1039.         /**
  1040.          * Set point
  1041.          *
  1042.          * @param string $point
  1043.          *
  1044.          * @return Customer
  1045.          */
  1046.         public function setPoint($point)
  1047.         {
  1048.             $this->point $point;
  1049.             return $this;
  1050.         }
  1051.         /**
  1052.          * Get point
  1053.          *
  1054.          * @return string
  1055.          */
  1056.         public function getPoint()
  1057.         {
  1058.             return $this->point;
  1059.         }
  1060.         /**
  1061.          * String representation of object
  1062.          *
  1063.          * @see http://php.net/manual/en/serializable.serialize.php
  1064.          *
  1065.          * @return string the string representation of the object or null
  1066.          *
  1067.          * @since 5.1.0
  1068.          */
  1069.         public function serialize()
  1070.         {
  1071.             // see https://symfony.com/doc/2.7/security/entity_provider.html#create-your-user-entity
  1072.             // CustomerRepository::loadUserByUsername() で Status をチェックしているため、ここでは不要
  1073.             return serialize([
  1074.                 $this->id,
  1075.                 $this->email,
  1076.                 $this->password,
  1077.                 $this->salt,
  1078.             ]);
  1079.         }
  1080.         /**
  1081.          * Constructs the object
  1082.          *
  1083.          * @see http://php.net/manual/en/serializable.unserialize.php
  1084.          *
  1085.          * @param string $serialized <p>
  1086.          * The string representation of the object.
  1087.          * </p>
  1088.          *
  1089.          * @return void
  1090.          *
  1091.          * @since 5.1.0
  1092.          */
  1093.         public function unserialize($serialized)
  1094.         {
  1095.             list(
  1096.                 $this->id,
  1097.                 $this->email,
  1098.                 $this->password,
  1099.                 $this->salt) = unserialize($serialized);
  1100.         }
  1101.     }