Advertisement
Guest User

Untitled

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