Guest User

Untitled

a guest
Apr 1st, 2016
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.86 KB | None | 0 0
  1. <?php
  2. namespace AppBundle\Entity;
  3.  
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Security\Core\User\UserInterface;
  6.  
  7. /**
  8. * @ORM\Table(name="app_users")
  9. * @ORM\Entity(repositoryClass="AppBundle\Entity\UserRepository")
  10. */
  11.  
  12. class User implements UserInterface, \Serializable{
  13.  
  14. /**
  15. * @ORM\Column(type="integer")
  16. * @ORM\Id
  17. * @ORM\GeneratedValue(strategy="AUTO")
  18. */
  19. private $id;
  20.  
  21. /**
  22. * @ORM\Column(type="string", length=25, unique=true)
  23. */
  24. private $username;
  25.  
  26. /**
  27. * @ORM\Column(type="string", length=64)
  28. */
  29. private $password;
  30.  
  31. /**
  32. * @ORM\Column(type="string", length=100, unique=true)
  33. */
  34. private $email;
  35.  
  36. /**
  37. * @ORM\Column(name="is_active", type="boolean")
  38. */
  39. private $isActive;
  40.  
  41. /**
  42. * @ORM\Column(type="string", length=30, unique=true)
  43. */
  44. private $nick;
  45.  
  46. /**
  47. * @ORM\Column(name="create_date", type="date")
  48. */
  49. private $createDate;
  50.  
  51. public function __construct() {
  52. $this->isActive = true;
  53. }
  54.  
  55. public function getSalt() {
  56. return null;
  57. }
  58.  
  59. public function getRoles() {
  60. return array('ROLE_USER');
  61. }
  62.  
  63. public function getUsername() {
  64. return $this->username;
  65. }
  66.  
  67. public function getPassword() {
  68. return $this->password;
  69. }
  70.  
  71. public function eraseCredentials() {
  72. }
  73.  
  74. /** @see \Serializable::serialize() */
  75. public function serialize() {
  76. return serialize(array(
  77. $this->id,
  78. $this->username,
  79. $this->password,
  80. ));
  81. }
  82.  
  83. /** @see \Serializable::unserialize() */
  84. public function unserialize($serialized) {
  85. list (
  86. $this->id,
  87. $this->username,
  88. $this->password,
  89. ) = unserialize($serialized);
  90. }
  91.  
  92. /**
  93. * Get id
  94. *
  95. * @return integer
  96. */
  97. public function getId()
  98. {
  99. return $this->id;
  100. }
  101.  
  102. /**
  103. * Set username
  104. *
  105. * @param string $username
  106. *
  107. * @return User
  108. */
  109. public function setUsername($username)
  110. {
  111. $this->username = $username;
  112.  
  113. return $this;
  114. }
  115.  
  116. /**
  117. * Set password
  118. *
  119. * @param string $password
  120. *
  121. * @return User
  122. */
  123. public function setPassword($password)
  124. {
  125. $this->password = $password;
  126.  
  127. return $this;
  128. }
  129.  
  130. /**
  131. * Set email
  132. *
  133. * @param string $email
  134. *
  135. * @return User
  136. */
  137. public function setEmail($email)
  138. {
  139. $this->email = $email;
  140.  
  141. return $this;
  142. }
  143.  
  144. /**
  145. * Get email
  146. *
  147. * @return string
  148. */
  149. public function getEmail()
  150. {
  151. return $this->email;
  152. }
  153.  
  154. /**
  155. * Set isActive
  156. *
  157. * @param boolean $isActive
  158. *
  159. * @return User
  160. */
  161. public function setIsActive($isActive)
  162. {
  163. $this->isActive = $isActive;
  164.  
  165. return $this;
  166. }
  167.  
  168. /**
  169. * Get isActive
  170. *
  171. * @return boolean
  172. */
  173. public function getIsActive()
  174. {
  175. return $this->isActive;
  176. }
  177.  
  178. /**
  179. * Set nick
  180. *
  181. * @param string $nick
  182. *
  183. * @return User
  184. */
  185. public function setNick($nick)
  186. {
  187. $this->nick = $nick;
  188.  
  189. return $this;
  190. }
  191.  
  192. /**
  193. * Get nick
  194. *
  195. * @return string
  196. */
  197. public function getNick()
  198. {
  199. return $this->nick;
  200. }
  201.  
  202. /**
  203. * Set createDate
  204. *
  205. * @param \DateTime $createDate
  206. *
  207. * @return User
  208. */
  209. public function setCreateDate($createDate)
  210. {
  211. $this->createDate = $createDate;
  212.  
  213. return $this;
  214. }
  215.  
  216. /**
  217. * Get createDate
  218. *
  219. * @return \DateTime
  220. */
  221. public function getCreateDate()
  222. {
  223. return $this->createDate;
  224. }
  225. }
Add Comment
Please, Sign In to add comment