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

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