1 | 2 | simandl | <?php |
2 | | | |
3 | | | namespace Phem\Libraries\Security\Model\MySQL; |
4 | | | |
5 | | | use Doctrine\ORM\Mapping\JoinColumn; |
6 | | | use Doctrine\ORM\Mapping\JoinTable; |
7 | | | use Doctrine\ORM\Mapping\ManyToMany; |
8 | | | use Doctrine\ORM\Mapping\OneToMany; |
9 | | | use Phem\Libraries\Security\Model\Common\Group as CommonGroup; |
10 | | | |
11 | | | /** |
12 | | | * @Entity @Table(name="admin_group") |
13 | | | */ |
14 | | | class Group extends CommonGroup |
15 | | | { |
16 | | | |
17 | | | /** @Id @Column(type="integer") @GeneratedValue */ |
18 | | | protected $id; |
19 | | | |
20 | | | /** @Column(type="string") */ |
21 | | | protected $name; |
22 | | | |
23 | | | /** @Column(type="string") */ |
24 | | | protected $description; |
25 | | | |
26 | | | /** |
27 | | | * @ManyToMany(targetEntity="User") |
28 | | | * @JoinTable(name="admin_membership", |
29 | | | * joinColumns={@JoinColumn(name="groupId", referencedColumnName="id")}, |
30 | | | * inverseJoinColumns={@JoinColumn(name="user", referencedColumnName="id")} |
31 | | | * ) |
32 | | | */ |
33 | | | protected $users; |
34 | | | |
35 | | | /** |
36 | | | * @OneToMany(targetEntity="Permission", mappedBy="group",cascade={"all"}) |
37 | | | */ |
38 | | | protected $permissions; |
39 | | | |
40 | | | public function getUsers() |
41 | | | { |
42 | | | return $this->users; |
43 | | | } |
44 | | | |
45 | | | public function setUsers($users) |
46 | | | { |
47 | | | $this->users = $users; |
48 | | | } |
49 | | | |
50 | | | public function getPermissions() |
51 | | | { |
52 | | | return $this->permissions; |
53 | | | } |
54 | | | |
55 | | | public function setPermissions($permissions) |
56 | | | { |
57 | | | $this->permissions = $permissions; |
58 | | | } |
59 | | | |
60 | | | public function getId() |
61 | | | { |
62 | | | return $this->id; |
63 | | | } |
64 | | | |
65 | | | public function setId($id) |
66 | | | { |
67 | | | $this->id = $id; |
68 | | | } |
69 | | | |
70 | | | public function getName() |
71 | | | { |
72 | | | return $this->name; |
73 | | | } |
74 | | | |
75 | | | public function setName($name) |
76 | | | { |
77 | | | $this->name = $name; |
78 | | | } |
79 | | | |
80 | | | public function getDescription() |
81 | | | { |
82 | | | return $this->description; |
83 | | | } |
84 | | | |
85 | | | public function setDescription($description) |
86 | | | { |
87 | | | $this->description = $description; |
88 | | | } |
89 | | | |
90 | | | } |