FOSSology
4.4.0
Open Source License Compliance by Open Source Software
ScannedLicense.php
Go to the documentation of this file.
1
<?php
2
/*
3
SPDX-FileCopyrightText: © 2023 Samuel Dushimimana <dushsam100@gmail.com>
4
SPDX-License-Identifier: GPL-2.0-only
5
*/
10
namespace
Fossology\UI\Api\Models;
11
12
class
ScannedLicense
13
{
18
private
$id
;
23
private
$shortname
;
28
private
$occurence
;
33
private
$unique
;
38
private
$spdxName
;
39
47
public
function
__construct
(
$id
,
$shortname
,
$occurence
,
$unique
,
$spdxName
)
48
{
49
$this->
id
=
$id
;
50
$this->shortname =
$shortname
;
51
$this->occurence =
$occurence
;
52
$this->unique =
$unique
;
53
$this->spdxName =
$spdxName
;
54
}
55
59
public
function
getId
()
60
{
61
return
$this->id
;
62
}
63
67
public
function
getShortname
()
68
{
69
return
$this->shortname
;
70
}
71
75
public
function
getOccurence
()
76
{
77
return
$this->occurence
;
78
}
79
83
public
function
getUnique
()
84
{
85
return
$this->unique
;
86
}
87
91
public
function
getSpdxName
()
92
{
93
return
$this->spdxName
;
94
}
95
101
public
function
getJSON
($version=ApiVersion::V1)
102
{
103
return
json_encode($this->
getArray
($version));
104
}
105
111
public
function
getArray
($version=ApiVersion::V1)
112
{
113
if
($version == ApiVersion::V2) {
114
return
[
115
'id'
=> $this->
getId
(),
116
'shortName'
=> $this->
getShortname
(),
117
'occurence'
=> $this->
getOccurence
(),
118
'unique'
=> $this->
getUnique
(),
119
'spdxName'
=> $this->
getSpdxName
()
120
];
121
}
122
return
[
123
'id'
=> $this->
getId
(),
124
'shortname'
=> $this->
getShortname
(),
125
'occurence'
=> $this->
getOccurence
(),
126
'unique'
=> $this->
getUnique
(),
127
'spdxName'
=> $this->
getSpdxName
()
128
];
129
}
130
134
public
function
setId
(
$id
)
135
{
136
$this->
id
=
$id
;
137
}
138
142
public
function
setShortname
(
$shortname
)
143
{
144
$this->shortname =
$shortname
;
145
}
146
150
public
function
setOccurence
(
$occurence
)
151
{
152
$this->occurence =
$occurence
;
153
}
154
158
public
function
setUnique
(
$unique
)
159
{
160
$this->unique =
$unique
;
161
}
162
166
public
function
setSpdxName
(
$spdxName
)
167
{
168
$this->spdxName =
$spdxName
;
169
}
170
}
Fossology\UI\Api\Models\ScannedLicense
Definition:
ScannedLicense.php:13
Fossology\UI\Api\Models\ScannedLicense\getJSON
getJSON($version=ApiVersion::V1)
Definition:
ScannedLicense.php:101
Fossology\UI\Api\Models\ScannedLicense\$unique
$unique
Definition:
ScannedLicense.php:33
Fossology\UI\Api\Models\ScannedLicense\__construct
__construct($id, $shortname, $occurence, $unique, $spdxName)
Definition:
ScannedLicense.php:47
Fossology\UI\Api\Models\ScannedLicense\setSpdxName
setSpdxName($spdxName)
Definition:
ScannedLicense.php:166
Fossology\UI\Api\Models\ScannedLicense\$id
$id
Definition:
ScannedLicense.php:18
Fossology\UI\Api\Models\ScannedLicense\getArray
getArray($version=ApiVersion::V1)
Definition:
ScannedLicense.php:111
Fossology\UI\Api\Models\ScannedLicense\setId
setId($id)
Definition:
ScannedLicense.php:134
Fossology\UI\Api\Models\ScannedLicense\$shortname
$shortname
Definition:
ScannedLicense.php:23
Fossology\UI\Api\Models\ScannedLicense\$spdxName
$spdxName
Definition:
ScannedLicense.php:38
Fossology\UI\Api\Models\ScannedLicense\getOccurence
getOccurence()
Definition:
ScannedLicense.php:75
Fossology\UI\Api\Models\ScannedLicense\getId
getId()
Definition:
ScannedLicense.php:59
Fossology\UI\Api\Models\ScannedLicense\getUnique
getUnique()
Definition:
ScannedLicense.php:83
Fossology\UI\Api\Models\ScannedLicense\setShortname
setShortname($shortname)
Definition:
ScannedLicense.php:142
Fossology\UI\Api\Models\ScannedLicense\getShortname
getShortname()
Definition:
ScannedLicense.php:67
Fossology\UI\Api\Models\ScannedLicense\setUnique
setUnique($unique)
Definition:
ScannedLicense.php:158
Fossology\UI\Api\Models\ScannedLicense\$occurence
$occurence
Definition:
ScannedLicense.php:28
Fossology\UI\Api\Models\ScannedLicense\setOccurence
setOccurence($occurence)
Definition:
ScannedLicense.php:150
Fossology\UI\Api\Models\ScannedLicense\getSpdxName
getSpdxName()
Definition:
ScannedLicense.php:91
src
www
ui
api
Models
ScannedLicense.php
Generated on Mon Nov 18 2024 07:37:14 for FOSSology by
1.9.1