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