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