Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once __DIR__ .'/Entity.php';
- class Usuario extends Entity
- {
- /**
- * @var int
- */
- protected $id;
- /**
- * @var string
- */
- private $username;
- /**
- * @var string
- */
- private $email;
- /**
- * @var string
- */
- private $password;
- /**
- * @param string $nombre
- * @param string $logo
- * @param string $descripcion
- */
- public function __construct(string $username = '', string $email = '', string $password = ''){
- $this->id = null;
- $this->username = $username;
- $this->email = $email;
- $this->password = $password;
- }
- /**
- * Get the value of id
- *
- * @return int
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set the value of id
- *
- * @param int $id
- *
- * @return self
- */
- public function setId(int $id)
- {
- $this->id = $id;
- return $this;
- }
- /**
- * Get the value of username
- *
- * @return string
- */
- public function getUsername()
- {
- return $this->username;
- }
- /**
- * Set the value of username
- *
- * @param string $username
- *
- * @return self
- */
- public function setUsername(string $username)
- {
- $this->username = $username;
- return $this;
- }
- /**
- * Get the value of email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->email;
- }
- /**
- * Set the value of email
- *
- * @param string $email
- *
- * @return self
- */
- public function setEmail(string $email)
- {
- $this->email = $email;
- return $this;
- }
- /**
- * Get the value of password
- *
- * @return string
- */
- public function getPassword()
- {
- return $this->password;
- }
- /**
- * Set the value of password
- *
- * @param string $password
- *
- * @return self
- */
- public function setPassword(string $password)
- {
- $this->password = $password;
- return $this;
- }
- public function toArray(): array
- {
- return [
- 'id' => $this->getId(),
- 'username' => $this->getUsername(),
- 'email' => $this->getEmail(),
- 'password' => $this->getPassword()
- ];
- }
- }
Add Comment
Please, Sign In to add comment