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

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