diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-09-06 20:21:49 +0200 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2017-06-23 09:18:39 +0200 |
commit | f1900b686eb8d7c41a940eede778234ac55086e1 (patch) | |
tree | 3282794540fceaecc831fc9c736cecc57dbc1728 /src/Wallabag | |
parent | 29714661b1df78871ceaf0e079f11041a8641d4b (diff) | |
download | wallabag-f1900b686eb8d7c41a940eede778234ac55086e1.tar.gz wallabag-f1900b686eb8d7c41a940eede778234ac55086e1.tar.zst wallabag-f1900b686eb8d7c41a940eede778234ac55086e1.zip |
Added migration for user group
Just a first draft of #805
Diffstat (limited to 'src/Wallabag')
-rw-r--r-- | src/Wallabag/UserBundle/Entity/Group.php | 20 | ||||
-rw-r--r-- | src/Wallabag/UserBundle/Entity/User.php | 12 |
2 files changed, 30 insertions, 2 deletions
diff --git a/src/Wallabag/UserBundle/Entity/Group.php b/src/Wallabag/UserBundle/Entity/Group.php new file mode 100644 index 00000000..9145959d --- /dev/null +++ b/src/Wallabag/UserBundle/Entity/Group.php | |||
@@ -0,0 +1,20 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\UserBundle\Entity; | ||
4 | |||
5 | use FOS\UserBundle\Model\Group as BaseGroup; | ||
6 | use Doctrine\ORM\Mapping as ORM; | ||
7 | |||
8 | /** | ||
9 | * @ORM\Entity | ||
10 | * @ORM\Table(name="`group`") | ||
11 | */ | ||
12 | class Group extends BaseGroup | ||
13 | { | ||
14 | /** | ||
15 | * @ORM\Id | ||
16 | * @ORM\Column(type="integer") | ||
17 | * @ORM\GeneratedValue(strategy="AUTO") | ||
18 | */ | ||
19 | protected $id; | ||
20 | } | ||
diff --git a/src/Wallabag/UserBundle/Entity/User.php b/src/Wallabag/UserBundle/Entity/User.php index aba76ca7..781f7b03 100644 --- a/src/Wallabag/UserBundle/Entity/User.php +++ b/src/Wallabag/UserBundle/Entity/User.php | |||
@@ -98,8 +98,16 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf | |||
98 | private $authCode; | 98 | private $authCode; |
99 | 99 | ||
100 | /** | 100 | /** |
101 | * @var bool | 101 | * @ORM\ManyToMany(targetEntity="Wallabag\UserBundle\Entity\Group") |
102 | * | 102 | * @ORM\JoinTable(name="user_group", |
103 | * joinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="id")}, | ||
104 | * inverseJoinColumns={@ORM\JoinColumn(name="group_id", referencedColumnName="id")} | ||
105 | * ) | ||
106 | */ | ||
107 | protected $groups; | ||
108 | |||
109 | /** | ||
110 | * @var bool Enabled yes/no | ||
103 | * @ORM\Column(type="boolean") | 111 | * @ORM\Column(type="boolean") |
104 | */ | 112 | */ |
105 | private $twoFactorAuthentication = false; | 113 | private $twoFactorAuthentication = false; |