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