commit a53c12d06cbdd98a5081bd10009ec98f94464dce
parent 541461af0c3a6fd4bd2b4bcfe35f083a4670d36a
Author: Felicitus <felicitus@felicitus.org>
Date: Tue, 8 Dec 2015 17:31:48 +0100
Added active flag
Diffstat:
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/src/PartKeepr/AuthBundle/Entity/User.php b/src/PartKeepr/AuthBundle/Entity/User.php
@@ -2,9 +2,9 @@
namespace PartKeepr\AuthBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
+use PartKeepr\CoreBundle\Entity\BaseEntity;
use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService;
use PartKeepr\DoctrineReflectionBundle\Annotation\VirtualField;
-use PartKeepr\CoreBundle\Entity\BaseEntity;
use Symfony\Component\Security\Core\User\EquatableInterface;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Serializer\Annotation\Groups;
@@ -80,11 +80,20 @@ class User extends BaseEntity implements UserInterface, EquatableInterface
* Holds the initial serialized user preferences
* @VirtualField(type="string")
* @Groups({"default"})
+ *
* @var string
*/
private $initialUserPreferences;
/**
+ * Defines if the user is active
+ * @ORM\Column(type="boolean")
+ *
+ * @var bool
+ */
+ private $active;
+
+ /**
* Creates a new user object.
*
* @param string $username The username to set (optional)
@@ -116,6 +125,26 @@ class User extends BaseEntity implements UserInterface, EquatableInterface
}
/**
+ * Returns if the user is active
+ *
+ * @return boolean
+ */
+ public function isActive()
+ {
+ return $this->active;
+ }
+
+ /**
+ * Sets if the user is active
+ *
+ * @param boolean $active
+ */
+ public function setActive($active)
+ {
+ $this->active = $active;
+ }
+
+ /**
* @return string
*/
public function getInitialUserPreferences()