* @UniqueEntity("email")
* @UniqueEntity("username")
*/
-class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterface
+class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterface, \Serializable
{
/**
* @var int
protected $entries;
/**
- * @ORM\OneToOne(targetEntity="Wallabag\CoreBundle\Entity\Config", mappedBy="user")
+ * @ORM\OneToOne(targetEntity="Wallabag\CoreBundle\Entity\Config", mappedBy="user", cascade={"remove"})
*/
protected $config;
{
parent::__construct();
$this->entries = new ArrayCollection();
- $this->roles = array('ROLE_USER');
+ $this->roles = ['ROLE_USER'];
}
/**
return false;
}
+
+ public function serialize()
+ {
+ return serialize($this->id);
+ }
+
+ public function unserialize($serialized)
+ {
+ $this->id = unserialize($serialized);
+ }
}