summaryrefslogtreecommitdiffstats
path: root/Core/Role
diff options
context:
space:
mode:
authorChristophe Coevoet <stof@notk.org>2012-07-14 17:42:15 +0200
committerChristophe Coevoet <stof@notk.org>2012-07-14 17:42:15 +0200
commitf636a80f1f0fa4b8ff0ca390212bf89af14a07fb (patch)
treec584a6773582ebc355dffcd1a852f78e440c53ee /Core/Role
parent46e7e6cf5307d8d336a08f0bc10f4d503602ecf8 (diff)
downloadsymfony-security-f636a80f1f0fa4b8ff0ca390212bf89af14a07fb.zip
symfony-security-f636a80f1f0fa4b8ff0ca390212bf89af14a07fb.tar.gz
symfony-security-f636a80f1f0fa4b8ff0ca390212bf89af14a07fb.tar.bz2
[Security] Implemented the Serializable interface in the Role class
Diffstat (limited to 'Core/Role')
-rw-r--r--Core/Role/Role.php18
1 files changed, 17 insertions, 1 deletions
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);
+ }
}