Guest User

Untitled

a guest
Nov 20th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.05 KB | None | 0 0
  1. <?php
  2.  
  3. namespace model;
  4.  
  5. /**
  6. * @Entity
  7. * @Table(name="user")
  8. */
  9. class User {
  10.  
  11. /**
  12. * @var integer
  13. * @Id
  14. * @Column(type="integer")
  15. * @GeneratedValue
  16. */
  17. protected $userId;
  18.  
  19. /**
  20. * @var string
  21. * @Column(type="string", length=45)
  22. */
  23. protected $userName;
  24.  
  25. /**
  26. * @var string
  27. * @Column(type="string", length=30)
  28. */
  29. protected $securityGroup;
  30.  
  31. /**
  32. * @var string
  33. * @Column(type="string", length=45)
  34. */
  35. protected $firstName;
  36.  
  37. /**
  38. * @var string
  39. * @Column(type="string", length=45)
  40. */
  41. protected $lastName;
  42.  
  43. /**
  44. * @var string
  45. * @Column(type="string", length=100)
  46. */
  47. protected $password;
  48.  
  49. /**
  50. * @var \DateTime
  51. * @Column(type="datetime")
  52. */
  53. protected $passwordExpiration;
  54.  
  55. /**
  56. * @var string
  57. * @Column(type="string", length=100)
  58. */
  59. protected $email;
  60.  
  61. /**
  62. * @var boolean
  63. * @Column(type="boolean")
  64. */
  65. protected $enabled;
  66.  
  67. /**
  68. * @var \DateTime
  69. * @column(type="datetime")
  70. */
  71. protected $dateTimeCreated;
  72.  
  73. /**
  74. * Organization (:assignment)
  75. *
  76. * @var Organization
  77. */
  78. protected $organization;
  79.  
  80. public function __construct() {
  81. $this->dateTimeCreated = new \DateTime("now", new \DateTimeZone('UTC'));
  82. }
  83.  
  84. /**
  85. * Retrieve User ID
  86. *
  87. * @return integer
  88. */
  89. public function getUserId() {
  90. return $this->userId;
  91. }
  92.  
  93. /**
  94. * Set User Name
  95. *
  96. * @param string $userName
  97. * @return User
  98. */
  99. public function setUserName($userName) {
  100. $this->userName = $userName;
  101. return $this;
  102. }
  103.  
  104. /**
  105. * Retrieve User Name
  106. *
  107. * @return string
  108. */
  109. public function getUserName() {
  110. return $this->userName;
  111. }
  112.  
  113. /**
  114. * Set Password
  115. *
  116. * @param string $password
  117. * @return User
  118. */
  119. protected function setPassword($password) {
  120. $this->password = $password;
  121. return $this;
  122. }
  123.  
  124. /**
  125. * Retrieve Password
  126. *
  127. * @return string
  128. */
  129. protected function getPassword() {
  130. return $this->password;
  131. }
  132.  
  133. /**
  134. * Set Password Expiration Date/Time
  135. *
  136. * @param mixed $passwordExpiration
  137. * @return User
  138. */
  139. protected function setPasswordExpiration($passwordExpiration) {
  140. $this->passwordExpiration = $passwordExpiration;
  141. return $this;
  142. }
  143.  
  144. /**
  145. * Retrieve Password Expiration Date/Time
  146. *
  147. * @return \DateTime
  148. */
  149. public function getPasswordExpiration() {
  150. return $this->passwordExpiration;
  151. }
  152.  
  153. /**
  154. * Set First Name
  155. *
  156. * @param string $firstName
  157. * @return User
  158. */
  159. public function setFirstName($firstName) {
  160. $this->firstName = $firstName;
  161. return $this;
  162. }
  163.  
  164. /**
  165. * Retrieve First Name
  166. *
  167. * @return string
  168. */
  169. public function getFirstName() {
  170. return $this->firstName;
  171. }
  172.  
  173. /**
  174. * Enable/Disable User
  175. *
  176. * @return User
  177. */
  178. public function setEnabled($enabled) {
  179. $this->enabled = $enabled;
  180. return $this;
  181. }
  182.  
  183. /**
  184. * Retrieve Enabled status
  185. *
  186. * @return integer
  187. */
  188. public function getEnabled() {
  189. return $this->enabled;
  190. }
  191.  
  192. /**
  193. * Proxies to the getEnabled method returning a boolean
  194. *
  195. * @return boolean
  196. */
  197. public function isEnabled() {
  198. return (bool) $this->getEnabled();
  199. }
  200.  
  201. /**
  202. * Set Last Name
  203. *
  204. * @param string $lastName
  205. * @return User
  206. */
  207. public function setLastName($lastName) {
  208. $this->lastName = $lastName;
  209. return $this;
  210. }
  211.  
  212. /**
  213. * Retrieve Last Name
  214. *
  215. * @return string
  216. */
  217. public function getLastName() {
  218. return $this->lastName;
  219. }
  220.  
  221. /**
  222. * Set Email
  223. *
  224. * @param string $email
  225. * @return User
  226. */
  227. public function setEmail($email) {
  228. $this->email = $email;
  229. return $this;
  230. }
  231.  
  232. /**
  233. * Retrieve Email
  234. *
  235. * @return string
  236. */
  237. public function getEmail() {
  238. return $this->email;
  239. }
  240.  
  241. /**
  242. * Retrieve Date/Time Created
  243. *
  244. * @return \DateTime
  245. */
  246. public function getDateTimeCreated() {
  247. return $this->dateTimeCreated;
  248. }
  249.  
  250. /**
  251. * Set Associated Organization Entity
  252. *
  253. * @param ets\model\Organization $organization
  254. * @return User
  255. */
  256. public function setOrganization(\ets\model\Organization $organization) {
  257. $this->organization = $organization;
  258. return $this;
  259. }
  260.  
  261. /**
  262. * Retrieve user's security group ID
  263. *
  264. * @return string
  265. */
  266. public function getSecurityGroup() {
  267. return $this->securityGroup;
  268. }
  269.  
  270. /**
  271. * Set user's security group ID
  272. *
  273. * @param $group
  274. * @return User
  275. */
  276. public function setSecurityGroup($securityGroup) {
  277. $this->securityGroup = $securityGroup;
  278. return $this;
  279. }
  280.  
  281. }
Add Comment
Please, Sign In to add comment