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

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