Guest User

Untitled

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