Advertisement
Guest User

Untitled

a guest
Feb 4th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: mario-radu
  5. * Date: 2/4/19
  6. * Time: 3:32 PM
  7. */
  8.  
  9. declare(strict_types=1);
  10.  
  11. namespace App\Entity;
  12.  
  13. use Doctrine\ORM\Mapping as ORM;
  14.  
  15. /**
  16. * @ORM\Entity
  17. * @ORM\Table(name="users")
  18. */
  19. class AppEntity implements \JsonSerializable
  20. {
  21. /**
  22. * @ORM\Id
  23. * @ORM\Column(type="integer", name="id", nullable=false)
  24. * @ORM\GeneratedValue(strategy="IDENTITY")
  25. */
  26. protected $id;
  27.  
  28.  
  29. /**
  30. * @ORM\Column(type="string",nullable=false)
  31. */
  32. protected $name;
  33.  
  34.  
  35. /**
  36. * @ORM\Column(type="string",nullable=false)
  37. */
  38. protected $email;
  39.  
  40.  
  41. /**
  42. * @ORM\Column(type="string",nullable=false)
  43. */
  44. protected $password;
  45.  
  46.  
  47. /**
  48. * @return mixed
  49. */
  50. public function getId()
  51. {
  52. return $this->id;
  53. }
  54.  
  55. /**
  56. * @param mixed $id
  57. */
  58. public function setId($id)
  59. {
  60. $this->id = $id;
  61. }
  62.  
  63. /**
  64. * @return mixed
  65. */
  66. public function getName()
  67. {
  68. return $this->name;
  69. }
  70.  
  71. /**
  72. * @param mixed $name
  73. */
  74. public function setName($name)
  75. {
  76. $this->name = $name;
  77. }
  78.  
  79. /**
  80. * @return mixed
  81. */
  82. public function getEmail()
  83. {
  84. return $this->email;
  85. }
  86.  
  87. /**
  88. * @param mixed $email
  89. */
  90. public function setEmail($email)
  91. {
  92. $this->email = $email;
  93. }
  94.  
  95. /**
  96. * @return mixed
  97. */
  98. public function getPassword()
  99. {
  100. return $this->password;
  101. }
  102.  
  103. /**
  104. * @param mixed $password
  105. */
  106. public function setPassword($password)
  107. {
  108. $this->password = $password;
  109. }
  110.  
  111.  
  112. public function jsonSerialize()
  113. {
  114. return [
  115. 'id' => $this->getId(),
  116. 'name' => $this->getName(),
  117. 'email' => $this->getEmail(),
  118. 'password' => $this->getPassword(),
  119. ];
  120. }
  121. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement