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

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