You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UserDBO.php 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: adrien.gandarias
  5. * Date: 08/04/2015
  6. * Time: 10:10
  7. */
  8. namespace App\Http\DBO;
  9. use Illuminate\Database\Eloquent\Model;
  10. class UserDBO extends AbstractModel
  11. {
  12. /**
  13. * @var int
  14. */
  15. private $id;
  16. /**
  17. * @var string
  18. */
  19. private $name;
  20. /**
  21. * (PHP 5 &gt;= 5.4.0)<br/>
  22. * Specify data which should be serialized to JSON
  23. * @link http://php.net/manual/en/jsonserializable.jsonserialize.php
  24. * @return mixed data which can be serialized by <b>json_encode</b>,
  25. * which is a value of any type other than a resource.
  26. */
  27. function jsonSerialize()
  28. {
  29. return [
  30. 'id' => $this->id,
  31. 'name' => $this->name
  32. ];
  33. }
  34. /**
  35. * @param int $id
  36. */
  37. public function setId($id)
  38. {
  39. $this->id = $id;
  40. }
  41. /**
  42. * @return int
  43. */
  44. public function getId()
  45. {
  46. return $this->id;
  47. }
  48. /**
  49. * @param string $name
  50. */
  51. public function setName($name)
  52. {
  53. $this->name = $name;
  54. }
  55. /**
  56. * @return string
  57. */
  58. public function getName()
  59. {
  60. return $this->name;
  61. }
  62. }