src/UserBundle/Entity/User.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\UserBundle\Entity;
  3. use App\UserBundle\Model\BaseUser;
  4. use App\UserBundle\Repository\UserRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use PN\ServiceBundle\Model\VirtualDeleteTrait;
  7. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. /**
  10. * @ORM\Table(name="`user`")
  11. * @ORM\Entity(repositoryClass=UserRepository::class)
  12. * @UniqueEntity(fields={"email"}, message="There is already an account with this email")
  13. */
  14. class User extends BaseUser
  15. {
  16. use VirtualDeleteTrait;
  17. const GENDER_MALE = 'male';
  18. const GENDER_FEMALE = 'female';
  19. /**
  20. * @ORM\Id
  21. * @ORM\GeneratedValue
  22. * @ORM\Column(type="integer")
  23. */
  24. private ?int $id = null;
  25. /**
  26. * @ORM\Column(name="full_name", type="string", length=255)
  27. */
  28. private string $fullName;
  29. /**
  30. * @ORM\Column(name="gender", type="string", length=20, nullable=true)
  31. */
  32. private ?string $gender = null;
  33. /**
  34. * @ORM\Column(name="birthdate", type="datetime", nullable=true)
  35. */
  36. private ?\DateTimeInterface $birthdate;
  37. /**
  38. * @Assert\Regex("/^[0-9\(\)\/\+ \-]+$/i")
  39. *
  40. * @ORM\Column(name="phone", type="string", nullable=true)
  41. */
  42. private ?string $phone;
  43. /**
  44. * @ORM\Column(name="facebook_id", type="string", length=255, nullable=true)
  45. */
  46. private ?string $facebookId;
  47. /**
  48. * @ORM\Column(name="google_id", type="string", length=255, nullable=true)
  49. */
  50. private ?string $googleId;
  51. /**
  52. * @ORM\Column(name="cart_item_no", type="integer", nullable=true)
  53. */
  54. private ?int $cartItemsNo = 0;
  55. /**
  56. * @ORM\Column(name="success_order_no", type="integer", nullable=true)
  57. */
  58. private ?int $successOrderNo = 0;
  59. public function getId(): ?int
  60. {
  61. return $this->id;
  62. }
  63. public function getFullName(): ?string
  64. {
  65. return $this->fullName;
  66. }
  67. public function setFullName(string $fullName): self
  68. {
  69. $this->fullName = $fullName;
  70. return $this;
  71. }
  72. public function getGender(): ?string
  73. {
  74. return $this->gender;
  75. }
  76. public function setGender(?string $gender): self
  77. {
  78. $this->gender = $gender;
  79. return $this;
  80. }
  81. public function getBirthdate(): ?\DateTimeInterface
  82. {
  83. return $this->birthdate;
  84. }
  85. public function setBirthdate(?\DateTimeInterface $birthdate): self
  86. {
  87. $this->birthdate = $birthdate;
  88. return $this;
  89. }
  90. public function getPhone(): ?string
  91. {
  92. return $this->phone;
  93. }
  94. public function setPhone(string $phone): self
  95. {
  96. $this->phone = $phone;
  97. return $this;
  98. }
  99. public function getFacebookId(): ?string
  100. {
  101. return $this->facebookId;
  102. }
  103. public function setFacebookId(?string $facebookId): self
  104. {
  105. $this->facebookId = $facebookId;
  106. return $this;
  107. }
  108. public function getGoogleId(): ?string
  109. {
  110. return $this->googleId;
  111. }
  112. public function setGoogleId(?string $googleId): self
  113. {
  114. $this->googleId = $googleId;
  115. return $this;
  116. }
  117. public function getCartItemsNo(): ?int
  118. {
  119. return $this->cartItemsNo;
  120. }
  121. public function setCartItemsNo(?int $cartItemsNo): self
  122. {
  123. $this->cartItemsNo = $cartItemsNo;
  124. return $this;
  125. }
  126. public function getSuccessOrderNo(): ?int
  127. {
  128. return $this->successOrderNo;
  129. }
  130. public function setSuccessOrderNo(?int $successOrderNo): self
  131. {
  132. $this->successOrderNo = $successOrderNo;
  133. return $this;
  134. }
  135. }