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