vendor/sulu/sulu/src/Sulu/Bundle/SecurityBundle/Entity/UserGroup.php line 22

Open in your IDE?
  1. <?php
  2. /*
  3. * This file is part of Sulu.
  4. *
  5. * (c) Sulu GmbH
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. namespace Sulu\Bundle\SecurityBundle\Entity;
  11. use JMS\Serializer\Annotation\SerializedName;
  12. use JMS\Serializer\Annotation\VirtualProperty;
  13. use Sulu\Bundle\CoreBundle\Entity\ApiEntity;
  14. use Sulu\Component\Security\Authentication\UserInterface;
  15. /**
  16. * @deprecated The group functionality was deprecated in Sulu 2.1 and will be removed in Sulu 3.0
  17. */
  18. class UserGroup extends ApiEntity
  19. {
  20. /**
  21. * @var string
  22. */
  23. private $locale;
  24. /**
  25. * @var int
  26. */
  27. private $id;
  28. /**
  29. * @var UserInterface|null
  30. */
  31. private $user;
  32. /**
  33. * @var Group|null
  34. */
  35. private $group;
  36. /**
  37. * Set locale.
  38. *
  39. * @param string $locale
  40. *
  41. * @return UserGroup
  42. */
  43. public function setLocale($locale)
  44. {
  45. $this->locale = $locale;
  46. return $this;
  47. }
  48. /**
  49. * Get locale.
  50. *
  51. * @return string
  52. */
  53. public function getLocale()
  54. {
  55. return $this->locale;
  56. }
  57. /**
  58. * Get Locales as array.
  59. *
  60. * @return array
  61. *
  62. * @VirtualProperty
  63. * @SerializedName("locales")
  64. */
  65. public function getLocales()
  66. {
  67. return \json_decode($this->locale);
  68. }
  69. /**
  70. * Get id.
  71. *
  72. * @return int
  73. */
  74. public function getId()
  75. {
  76. return $this->id;
  77. }
  78. /**
  79. * Set user.
  80. *
  81. * @return UserGroup
  82. */
  83. public function setUser(?UserInterface $user = null)
  84. {
  85. $this->user = $user;
  86. return $this;
  87. }
  88. /**
  89. * Get user.
  90. *
  91. * @return UserInterface|null
  92. */
  93. public function getUser()
  94. {
  95. return $this->user;
  96. }
  97. /**
  98. * Set group.
  99. *
  100. * @return UserGroup
  101. */
  102. public function setGroup(?Group $group = null)
  103. {
  104. $this->group = $group;
  105. return $this;
  106. }
  107. /**
  108. * Get group.
  109. *
  110. * @return Group|null
  111. */
  112. public function getGroup()
  113. {
  114. return $this->group;
  115. }
  116. }