[Security] Implemented the Serializable interface in the Role class

This commit is contained in:
Christophe Coevoet 2012-07-14 17:42:15 +02:00
parent 28abff8147
commit b55930a45b
2 changed files with 18 additions and 1 deletions

View File

@ -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

View File

@ -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);
}
}