FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Group.php
Go to the documentation of this file.
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2021 Orange
4 Author: Piotr Pszczola <piotr.pszczola@orange.com>
5 
6  SPDX-License-Identifier: GPL-2.0-only
7 */
13 namespace Fossology\UI\Api\Models;
14 
15 class Group
16 {
17 
21  private $id;
22 
26  private $name;
27 
34  public function __construct($id, $name)
35  {
36  $this->id = intval($id);
37  $this->name = $name;
38  }
39 
41 
45  public function getId()
46  {
47  return $this->id;
48  }
49 
53  public function getName()
54  {
55  return $this->name;
56  }
57 
61  public function getJSON()
62  {
63  return json_encode($this->getArray());
64  }
65 
67 
71  public function setId($id)
72  {
73  $this->id = intval($id);
74  }
75 
79  public function setName($name)
80  {
81  $this->name = $name;
82  }
83 
89  public function getArray()
90  {
91  return [
92  'id' => intval($this->id),
93  'name' => $this->name
94  ];
95  }
96 }