Advertisement
Guest User

Untitled

a guest
Oct 9th, 2015
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. <?php
  2.  
  3. namespace AppBundle\Entity;
  4.  
  5. use Symfony\Component\Security\Core\User\UserInterface;
  6.  
  7. class UserSetting
  8. {
  9. /**
  10. * @var UserInterface
  11. * @ORM\ManyToOne(targetEntity="User", inversedBy="settings", fetch="EXTRA_LAZY")
  12. * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
  13. */
  14. protected $user;
  15.  
  16. /**
  17. * @var string
  18. */
  19. protected $key;
  20.  
  21. /**
  22. * @var string
  23. */
  24. protected $value;
  25.  
  26. /**
  27. * Just for easying the creation of new UserSetting objects
  28. *
  29. * @param string $key
  30. * @param string $value
  31. */
  32. public function __construct($key = null, $value = null)
  33. {
  34. $this->key = $key;
  35. $this->value = $value;
  36. }
  37.  
  38. /**
  39. * Magic Method
  40. */
  41. public function __toString()
  42. {
  43. return (string) $this->value;
  44. }
  45.  
  46. /**
  47. * @return UserInterface
  48. */
  49. public function getUser()
  50. {
  51. $this->user;
  52. }
  53.  
  54. /**
  55. * @param UserInterface $user
  56. * @return self
  57. */
  58. public function setUser(UserInterface $user)
  59. {
  60. $this->user = $user;
  61.  
  62. return $this;
  63. }
  64.  
  65. public function getKey()
  66. {
  67. return $this->key;
  68. }
  69.  
  70. public function setKey($key)
  71. {
  72. $this->key = $key;
  73.  
  74. return $tihs;
  75. }
  76.  
  77. public function getValue()
  78. {
  79. return $this->value;
  80. }
  81.  
  82. public function setValue($value)
  83. {
  84. $this->value = $value;
  85.  
  86. return $this;
  87. }
  88. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement