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