FOSSology
4.4.0
Open Source License Compliance by Open Source Software
LicenseDecision.php
Go to the documentation of this file.
1
<?php
2
/*
3
SPDX-FileCopyrightText: © 2023 Samuel Dushimimana <dushsam100@gmail.com>
4
5
SPDX-License-Identifier: GPL-2.0-only
6
*/
7
13
namespace
Fossology\UI\Api\Models;
14
15
use PhpOffice\PhpSpreadsheet\Calculation\Logical\Boolean;
16
22
class
LicenseDecision
extends
License
23
{
28
const
ALLOWED_KEYS = [
'shortName'
,
'fullName'
,
'text'
,
'url'
,
'risk'
,
29
'isCandidate'
,
'mergeRequest'
,
'source'
,
'acknowledgement'
,
'comment'
];
30
35
private
$sources
;
40
private
$acknowledgement
;
45
private
$comment
;
46
51
private
$isMainLicense
;
52
57
private
$isRemoved
;
58
64
public
function
__construct
(
$id
,
65
$shortName
=
""
,
66
$fullName
=
""
,
67
$text
=
""
,
68
$url
=
""
,
69
$sources
= [],
$acknowledgement
=
""
,
$comment
=
""
,
70
$isMainLicense
=
false
,
71
$obligations
=
null
,
72
$risk =
null
,
73
$isRemoved
=
false
,
74
$isCandidate
=
false
)
75
{
76
parent::__construct(
77
$id
,
78
$shortName
,
79
$fullName
,
80
$text
,
81
$url
,
82
$obligations
,
83
$risk,
84
$isCandidate
85
);
86
$this->
setSources
(
$sources
);
87
$this->
setAcknowledgement
(
$acknowledgement
);
88
$this->
setComment
(
$comment
);
89
$this->
setIsMainLicense
(
$isMainLicense
);
90
$this->
setIsRemoved
(
$isRemoved
);
91
}
92
93
98
public
function
getJSON
()
99
{
100
return
json_encode($this->
getArray
());
101
}
102
107
public
function
getArray
()
108
{
109
$data = parent::getArray();
110
$data[
'sources'
] = $this->
getSources
();
111
$data[
'acknowledgement'
] = $this->
getAcknowledgement
();
112
$data[
'comment'
] = $this->
getComment
();
113
$data[
'isMainLicense'
] = $this->
getIsMainLicense
();
114
$data[
'isRemoved'
] = $this->
getIsRemoved
();
115
return
$data;
116
}
117
121
public
function
getSources
(): array
122
{
123
return
$this->sources
;
124
}
125
129
public
function
setSources
(array
$sources
): void
130
{
131
$this->sources =
$sources
;
132
}
133
137
public
function
getAcknowledgement
(): string
138
{
139
return
$this->acknowledgement
;
140
}
141
145
public
function
setAcknowledgement
(
string
$acknowledgement
): void
146
{
147
$this->acknowledgement =
$acknowledgement
;
148
}
149
153
public
function
getComment
(): string
154
{
155
return
$this->comment
;
156
}
157
161
public
function
setComment
(
string
$comment
): void
162
{
163
$this->comment =
$comment
;
164
}
165
169
public
function
setIsRemoved
(
bool
$isRemoved
): void
170
{
171
$this->isRemoved =
$isRemoved
;
172
}
173
177
public
function
getIsRemoved
(): bool
178
{
179
return
$this->isRemoved
;
180
}
181
185
public
function
getIsMainLicense
(): bool
186
{
187
return
$this->isMainLicense
;
188
}
189
193
public
function
setIsMainLicense
(
bool
$isMainLicense
): void
194
{
195
$this->isMainLicense =
$isMainLicense
;
196
}
197
}
Fossology\UI\Api\Models\LicenseDecision
Definition:
LicenseDecision.php:23
Fossology\UI\Api\Models\LicenseDecision\getComment
getComment()
Definition:
LicenseDecision.php:153
Fossology\UI\Api\Models\LicenseDecision\setIsRemoved
setIsRemoved(bool $isRemoved)
Definition:
LicenseDecision.php:169
Fossology\UI\Api\Models\LicenseDecision\getArray
getArray()
Definition:
LicenseDecision.php:107
Fossology\UI\Api\Models\LicenseDecision\$comment
$comment
Definition:
LicenseDecision.php:45
Fossology\UI\Api\Models\LicenseDecision\setIsMainLicense
setIsMainLicense(bool $isMainLicense)
Definition:
LicenseDecision.php:193
Fossology\UI\Api\Models\LicenseDecision\$sources
$sources
Definition:
LicenseDecision.php:35
Fossology\UI\Api\Models\LicenseDecision\__construct
__construct($id, $shortName="", $fullName="", $text="", $url="", $sources=[], $acknowledgement="", $comment="", $isMainLicense=false, $obligations=null, $risk=null, $isRemoved=false, $isCandidate=false)
Definition:
LicenseDecision.php:64
Fossology\UI\Api\Models\LicenseDecision\getJSON
getJSON()
Definition:
LicenseDecision.php:98
Fossology\UI\Api\Models\LicenseDecision\getAcknowledgement
getAcknowledgement()
Definition:
LicenseDecision.php:137
Fossology\UI\Api\Models\LicenseDecision\getIsRemoved
getIsRemoved()
Definition:
LicenseDecision.php:177
Fossology\UI\Api\Models\LicenseDecision\$acknowledgement
$acknowledgement
Definition:
LicenseDecision.php:40
Fossology\UI\Api\Models\LicenseDecision\setSources
setSources(array $sources)
Definition:
LicenseDecision.php:129
Fossology\UI\Api\Models\LicenseDecision\$isRemoved
$isRemoved
Definition:
LicenseDecision.php:57
Fossology\UI\Api\Models\LicenseDecision\setComment
setComment(string $comment)
Definition:
LicenseDecision.php:161
Fossology\UI\Api\Models\LicenseDecision\$isMainLicense
$isMainLicense
Definition:
LicenseDecision.php:51
Fossology\UI\Api\Models\LicenseDecision\setAcknowledgement
setAcknowledgement(string $acknowledgement)
Definition:
LicenseDecision.php:145
Fossology\UI\Api\Models\LicenseDecision\getIsMainLicense
getIsMainLicense()
Definition:
LicenseDecision.php:185
Fossology\UI\Api\Models\LicenseDecision\getSources
getSources()
Definition:
LicenseDecision.php:121
Fossology\UI\Api\Models\License
Definition:
License.php:20
Fossology\UI\Api\Models\License\$fullName
$fullName
Definition:
License.php:41
Fossology\UI\Api\Models\License\$id
$id
Definition:
License.php:31
Fossology\UI\Api\Models\License\$shortName
$shortName
Definition:
License.php:36
Fossology\UI\Api\Models\License\$obligations
$obligations
Definition:
License.php:56
Fossology\UI\Api\Models\License\$text
$text
Definition:
License.php:46
Fossology\UI\Api\Models\License\$isCandidate
$isCandidate
Definition:
License.php:66
Fossology\UI\Api\Models\License\$url
$url
Definition:
License.php:51
src
www
ui
api
Models
LicenseDecision.php
Generated on Mon Nov 18 2024 07:37:14 for FOSSology by
1.9.1