Guest User

Untitled

a guest
Nov 27th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. <?php
  2. require_once __DIR__ .'/Entity.php';
  3. class Usuario extends Entity
  4. {
  5.  
  6. /**
  7. * @var int
  8. */
  9. protected $id;
  10.  
  11. /**
  12. * @var string
  13. */
  14. private $username;
  15.  
  16. /**
  17. * @var string
  18. */
  19. private $email;
  20.  
  21. /**
  22. * @var string
  23. */
  24. private $password;
  25.  
  26. /**
  27. * @param string $nombre
  28. * @param string $logo
  29. * @param string $descripcion
  30. */
  31. public function __construct(string $username = '', string $email = '', string $password = ''){
  32. $this->id = null;
  33. $this->username = $username;
  34. $this->email = $email;
  35. $this->password = $password;
  36. }
  37.  
  38. /**
  39. * Get the value of id
  40. *
  41. * @return int
  42. */
  43. public function getId()
  44. {
  45. return $this->id;
  46. }
  47.  
  48. /**
  49. * Set the value of id
  50. *
  51. * @param int $id
  52. *
  53. * @return self
  54. */
  55. public function setId(int $id)
  56. {
  57. $this->id = $id;
  58.  
  59. return $this;
  60. }
  61.  
  62. /**
  63. * Get the value of username
  64. *
  65. * @return string
  66. */
  67. public function getUsername()
  68. {
  69. return $this->username;
  70. }
  71.  
  72. /**
  73. * Set the value of username
  74. *
  75. * @param string $username
  76. *
  77. * @return self
  78. */
  79. public function setUsername(string $username)
  80. {
  81. $this->username = $username;
  82.  
  83. return $this;
  84. }
  85.  
  86. /**
  87. * Get the value of email
  88. *
  89. * @return string
  90. */
  91. public function getEmail()
  92. {
  93. return $this->email;
  94. }
  95.  
  96. /**
  97. * Set the value of email
  98. *
  99. * @param string $email
  100. *
  101. * @return self
  102. */
  103. public function setEmail(string $email)
  104. {
  105. $this->email = $email;
  106.  
  107. return $this;
  108. }
  109.  
  110. /**
  111. * Get the value of password
  112. *
  113. * @return string
  114. */
  115. public function getPassword()
  116. {
  117. return $this->password;
  118. }
  119.  
  120. /**
  121. * Set the value of password
  122. *
  123. * @param string $password
  124. *
  125. * @return self
  126. */
  127. public function setPassword(string $password)
  128. {
  129. $this->password = $password;
  130.  
  131. return $this;
  132. }
  133.  
  134. public function toArray(): array
  135. {
  136. return [
  137. 'id' => $this->getId(),
  138. 'username' => $this->getUsername(),
  139. 'email' => $this->getEmail(),
  140. 'password' => $this->getPassword()
  141. ];
  142. }
  143. }
Add Comment
Please, Sign In to add comment