diff options
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | Core/Role/Role.php | 18 |
2 files changed, 18 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 797462b..8c98be1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ CHANGELOG 2.1.0 ----- + * Added the Serializable interface on the Role class * [BC BREAK] The signature of ExceptionListener has changed * changed the HttpUtils constructor signature to take a UrlGenerator and a UrlMatcher instead of a Router * EncoderFactoryInterface::getEncoder() can now also take a class name as an argument diff --git a/Core/Role/Role.php b/Core/Role/Role.php index 5b50981..7f16302 100644 --- a/Core/Role/Role.php +++ b/Core/Role/Role.php @@ -17,7 +17,7 @@ namespace Symfony\Component\Security\Core\Role; * * @author Fabien Potencier <fabien@symfony.com> */ -class Role implements RoleInterface +class Role implements RoleInterface, \Serializable { private $role; @@ -38,4 +38,20 @@ class Role implements RoleInterface { return $this->role; } + + /** + * {@inheritdoc} + */ + public function serialize() + { + return serialize($this->role); + } + + /** + * {@inheritdoc} + */ + public function unserialize($serialized) + { + $this->role = unserialize($serialized); + } } |