FOSSology  4.4.0
Open Source License Compliance by Open Source Software
UserGroupMember.php
Go to the documentation of this file.
1 <?php
2 /*
3  * SPDX-FileCopyrightText: © 2022 Samuel Dushimimana <dushsam100@gmail.com>
4  *
5  * SPDX-License-Identifier: GPL-2.0-only
6 */
7 
13 namespace Fossology\UI\Api\Models;
14 
16 {
17 
21  private $user;
22 
26  private $group_perm;
27 
34  public function __construct($user, $group_perm)
35  {
36  $this->user = $user;
37  $this->group_perm = intval($group_perm);
38  }
39 
41 
45  public function setUser($user)
46  {
47  $this->user = $user;
48  }
49 
53  public function setGroupPerm($group_perm)
54  {
55  $this->group_perm = intval($group_perm);
56  }
57 
58 
60 
64  public function getUser()
65  {
66  return $this->user;
67  }
68 
72  public function getGroupPerm()
73  {
74  return $this->group_perm;
75  }
76 
80  public function getJSON()
81  {
82  return json_encode($this->getArray());
83  }
84 
90  public function getArray()
91  {
92  return [
93  'user' => $this->user->getArray(),
94  'group_perm' => intval($this->group_perm)
95  ];
96  }
97 }